Fixed import cycle with dependency injection.