refactor some codes in reservations_parse