Refactored factory and provider dependencies.