minor refactoring of create_index in pmi_cluster.py