More template refactoring.