refactor for api change