Templates refactoring.