generalize scheduler class plus test cases