Many changes to add trace UI