provider refactoring