cleanup compact and clear