Changed to using dynamic calls for the templates rather than embedding them in the page.