Refactor Scope iterator