Please, check factory here; `ensureFactoryIsNotNull(factory)`.