restructure of tracebuffer