update and clean up