Refactored jinja into static with functions in request context