adapted to deprecations