refactor templates to use a base templat