switched to jinja templating, separated code from html