Some more refactoring of the schedule generator