Larger code cleanup.