complete template refactor to use base template