Use append_to_html  rather than function  to_html: STRING
this is mainly to avoid creating useless intermediary strings.
prefer 2 append call, rather than create a temp intermediary string object with +