some code improvement