clean up clustering functions