moved the html to an xtemplate