update and cleaup