Simplify the hilariously and needlessly complex IDMatches()