Service provider improvements
General refactoring