private function constructAction($action, array $arguments = []): bool
    {
        if (is_callable($action)) {
            $this->pendingAction = $action;

            return true;
        } elseif (is_string($action)) {
            $actionParts = explode('@', $action);

            $controllerName = 'App\\Http\\Controllers\\' . $actionParts[0];
            $methodName = $actionParts[1];

            if (!class_exists($controllerName)) {
                throw new HTTPException('Not found', 404);
            }

            $controller = $this->container->get($controllerName);

            if (!method_exists($controller, $methodName)) {
                throw new HTTPException('Not found', 404);
            }

            $this->pendingAction = [
                'controller' => $controllerName,
                'method' => $methodName,
                'arguments' => $arguments,
            ];

            return true;
        }

        return false;
    }