refactor templats to use a base template