Remove duplicate code by using util::copy()
Return proper errors with update_err