abstracted route regex if statment to dictionary
changed indexOf to use  operator