refactor html_template