more accurate interactive trace, refactor