clean up some code