Update to use new apis.