Minor refactoring to WeightedQuickUnion