Merge the multiple traces of an execution into one

Alos refine some types