Major cleanup

Changed a hell of a lot, not even sure anymore what I did..