private function loadRoute(App $slim, $name, array $details)
    {
        $methods = $this->methods($details);
        $pattern = $this->nullable('route', $details);
        $stack = $this->nullable('stack', $details) ?: [];

        $controller = array_pop($stack);

        $route = $slim->map($methods, $pattern, $controller);
        $route->setName($name);

        while ($middleware = array_pop($stack)) {
            $route->add($middleware);
        }

        return $route;
    }