Refactor make_html to use flask in a more usual way