adapted to latest sdk refactoring