Cleanup to use latest apis