Cleaning up clean up code