Optimization to prevent excessive matching