KCINFR-979: moving scheduler code