Refactored ServiceProvider
Fixed tests