refactors scopes to remove deprecations warnings