Remove reliance on deprecated API.