avoiding double computation of the same match