Simplify tracing code a bit