Update TemplateEngine class