minor xaml and template updates; support full replacement for templates.