protected function createDispatcher()
    {
        $options = array();

        $options += [
               'routeParser' => 'FastRoute\\RouteParser\\Std',
               'dataGenerator' => 'FastRoute\\DataGenerator\\GroupCountBased',
              'dispatcher' => 'FastRoute\\Dispatcher\\GroupCountBased',
        ];

        $routeCollector = new RouteCollector(
            new $options['routeParser'](), new $options['dataGenerator']()
        );

        $routeCollector->setRequest($this->request);

        foreach ($this->routes as $route) {
            $routeCollector->addRoute($route->getMethod(), $route->getConvertedRoute(), $route->getRouteHandler());
        }

        return new $options['dispatcher']($routeCollector->getData());
    }