Improve scoped
Merge pull request #1215 from monarchdodra/scope

Improve scoped implementation