Small refactors while browsing code to add event tracing
old note files
Cleanup and refactor before add trace events