refactoring Template loaders