I've been working with various versions of this for a while now, and it saves me a lot of time so I thought I would share.