refactored chained scopes into ScopeGenerator class