Refactored rank coalescing