[Qiushi] refactored code according to Yi's suggestion