Cleaned up the trace interface and implementation.