Add assertions for scope.
Remove unnecessary code.
Refactoring - 1st step.