refactor templates to use base template