refactor sched.