Extract update_item method