Refactor timetable parser