More refactoring in the templates.