Consolidation and tidying of scopes.