Continued rewriting of template engine