Template refactoring.