template services + refactoring