misc cleanup. switched to using jinja2 templates