refactoring index route