Refactored total match count