Copied AIP deletion work from master.