Learned Jinja2; made code less horrifying