refactoring match and matchService