Refactoring of templates.