We don't need to extract ancestry_b until we after we've checked for existence. It seems to make sense to check 'b in ancestry_a' first, though we might consider checking a in ancestry_b first. b in a is merging something which has already been merged. a in b is merging something which has merged you. And 'a in b' may actually be more common. The timing difference is fairly small, though.