Refactor the index route for readability