protected function iterateRoutes(string $function)
    {
        if (($route = $function($this->routes)) !== false) {
            $this->currentRoute = $route;
            return $this->currentRoute;
        }
        return false;
    }