Properly sort routes