Code cleanup. Mostly.