improved dependency injection