making kernel thread scheduler modular