made some code optimization