WDMX, WDpremMX and DPX make this a lot easier. If you are happy using place-holders for code give this a look.