refactor api for HtmlBuilder