luborliu/patch-3 Improve the efficiency of the code