Common utils - utils for kmeans.