Cleanup before updating