implement as_html