Refactored service as a provider so it can be configured