scheduler refactoring