clean up some of the code