improved code of DebugTemplate

renamed debug to trace
moved them trace directory