abstract the route specification logic