cleanup and compress