Cleanup and update logics