refactoring providers and templates for readability