public function match(RequestInterface $request)
    {
        foreach ($this->routes as $name => $route) {
            if (!$route->match($request)) {
                continue;
            }

            foreach ($route->arguments() as $key => $value) {
                $request->query()
                    ->set($key, $value);
            }

            $request->language($request->query()->get('language'));
            $request->format($request->query()->get('format'));

            $request->route($name);

            $this->defaults = [
                'host' => $request->baseName(),
                'route' => $name,
                'language' => $request->language(),
                'format' => $request->format()
            ];

            return $route->controller();
        }

        throw new RouterException('Route for "' . $request->path() . '" not found!');
    }