improvements and new TemplateProcessor with test