Refactor exact match in files to reuse existing method