unified update and clean method