now fully functional and tested: when a process finishes, all traces from it are removed
organizing the defines