refactor template to use a base template