template refactors