The Great Cleanup, refactor and other thingies