Scheduller refactoring