My approach was to set up template files and use the replace reference option.
See if this will work for you (with a few tweaks)