cleanup and clustering