Use append_to_html  rather than function  to_html: STRING
this is mainly to avoid creating useless intermediary strings.