Refactored group/range matching algorithm for use with latest data structures