refactored html templates

better templating with jinja