Support optional dependency injection