create and use TemplateEngine class