Refactored ScheduleTree to be more concise.