refactor for using the new style API in SDK 1.23.0