Refactor the configuration code in the trace module.