some code clean up