protected function getRoutes($method = null, array $routes = [])
    {
        if (null !== $method) {
            if (false === isset($routes[$method])) {
                throw new Doozr_Route_Exception(
                    sprintf(
                        'No routes for HTTP-method "%s" found.',
                        $method
                    ),
                    Doozr_Http::METHOD_NOT_ALLOWED
                );
            }
            $routes = $routes[$method];
        }

        return $routes;
    }