Migrate  to latest API