refactoring of scheduling functions