refactoring for more generic provider operation