optimize code
k