Improvements for match pairs generator