moves scheduling logic into ScheduleController