2.1 master

Remove unnecessary loop in TemplateRepository.getTemplate method