cleaning up some code