scheduler: fix the merge conficts

this is a partial revert of commits:
fab2cc5d44ea9799093bffaa136aae212747e3b1
45ded96e594fbc88dcc47ceaaf7225a1fe7765b3