refactoring scope references