Adapting to latest API changes