replaced text/template HTMLEscapeString with custom impl.
Minor updates