protected function setControllerVars($controller)
    {
        $this->controller = $controller;

        if (is_callable($controller)) {
            $this->setControllerCallable($controller);
        } else {
            $this->usesCallable = false;
            $atCharPos = strpos($controller, '@');

            // Make sure the "@" is somewhere in the middle of the string
            if ($atCharPos === false || $atCharPos === 0 || $atCharPos === mb_strlen($controller) - 1) {
                throw new InvalidArgumentException('Controller string is not formatted correctly');
            }

            $this->controllerName = substr($controller, 0, $atCharPos);
            $this->controllerMethod = substr($controller, $atCharPos + 1);
        }
    }