Stateful TemplateEngine