Clustering enhancements (#4822)