Get rid of usage of deprecated API.