Added proper dependency injection.