Encapsulate code into write_html().