private function uriKeyExists($nextUriPart, array $pageMap) {
    if (array_key_exists($nextUriPart, $pageMap)) {
      return $nextUriPart;
    }
    $keys = array_keys($pageMap);
    $variableParts = array_values(preg_grep('/\{(.*)\}/', $keys));
    $variablePartsCount = count($variableParts);
    if ($variablePartsCount === 0) {
      return null;
    } elseif ($variablePartsCount > 1) {
      throw new RoutingException('Single node has more than one variable key');
    }
    $variablePartRaw = $variableParts[0];
    $variablePart = preg_replace(['/\{/', '/\}/'], '', $variablePartRaw);
    if (array_key_exists($variablePart, $this->uriVariables)) {
      throw new RoutingException('a key named ' . $variablePart . ' appears more than once on a single route');
    }
    $this->uriVariables[$variablePart] = $nextUriPart;
    return $variablePartRaw;
  }