Refactor the view route