Updating to best practice for new API