Implementation using ScopeBuffer.