Refactored repositories to use ProviderFactory