Refactor NDRanges.