protected function createControllerInstance($controllerName, $actionId = null, $config = [])
    {
        if (!isset($controllerName)) {
            return [null, $actionId];
        } elseif ($controllerName instanceof ControllerInterface) {
            $controller = $controllerName;
            if (!isset($actionId) || !$controller->hasAction($actionId)) {
                $actionId = $controller->defaultAction;
            }
            return [$controller, $actionId];
        }
        $controller = null;
        foreach ($this->controllerNamespaces as $namespace) {
            $controllerNameFull = $namespace . '\\' . $controllerName;
            if (!class_exists($controllerNameFull)) {
                continue;
            }
            try {
                /** @var ControllerInterface $controller */
                $config = Reaction\Helpers\ArrayHelper::merge($config, ['class' => $controllerNameFull]);
                $controller = Reaction::create($config);
                if (!isset($actionId) || !$controller->hasAction($actionId)) {
                    $actionId = $controller->defaultAction;
                }
                break;
            } catch (InvalidConfigException $exception) {
                $controller = null;
                continue;
            }
        }
        return [$controller, $actionId];
    }