better configuration and cleanup of index