redid routing logic
index