refactor to make routes/index a router