Infrastructure for dynamic scopes.