modify:optimize code