refactored templates to use a base template