Convert templates to jinja and fix decorator