public function map($method, $route, $target, $name = null, $hostGroup = null, $prepend = false)
    {
        if (!$hostGroup) {
            $hostGroup = null;
        }

        if ($prepend) {
            array_unshift($this->routes, array($method, $route, $target, $name, $hostGroup));
        } else {
            $this->routes[] = array($method, $route, $target, $name, $hostGroup);
        }

        if ($name) {
            if (array_key_exists($name, $this->namedRoutes)) {
                throw new HaltoRouterException("Can not redeclare route $name");
            }

            $this->namedRoutes[$name] = array($route, $hostGroup);
        }

        return $this;
    }