Base template refactoring