Big cleanup

Yes I know, bad commit message.