Cleans up some code