small scheduler refactoring