Cleaning up some code, making some worse.