MASSIVE code cleaning