gap code cleanup