Cleanup: unified event classification logic and compile warnings fixes