Scheduler refactor

Follow-up from #27.