I think a comment here saying along the lines of "After setting the new criteria, we want to remove all of the old criteria for the badge" might be good – it took me a hot minute to figure out why you were deleting things.