reduce len calls in update_many