refactor clusters_from_iter