Small refactor of Scope resolution