clean up and more improve trace output