Remove duplicated code from some previous merge.