Fix event profiling; More refactoring

Fix event profiling
Use object directly, instead of the shared_ptr version
Use move constructor & assign operator to avoid extra RetainFunc()