Another massive code cleanup.