Extract match method to an isolated class