protected function loadFactory(?array $params=[])
  {
    if (\is_array($params) && !empty($params['class']) && \class_exists($params['class'])) {
      $factory = new $params['class']($params['options'] ?? []);
      $this->getLogger()->debug('Factory created',[
        'factory'=>$factory
      ]);

      return $factory;
    } else {
      $this->getLogger()->error('Factory not found',[
        'params'=>$params
      ]);

    }

    return null;
  }