simplify conditions for getting matches