refactor Trace