Hongyi: clean code for scheduler