cleans up some code