Moving matching into its own class