Modification to support HtmlTemplate