Added dependency injection.