Dev. checkpoint: Started: refactoring manipulating scopes.