Refactored grouping of number/directive number highlighting