refactor the singlestep trace operation