More tracing refactoring