scheduler: code refactoring
scheduler: code refactoring
scheduler: code refactoring