Deduplicate some match logic