refactoring base templates