cleanup matching logic prover step 1

ready for review