refactored Matches class