use event factory functions
Merge pull request #18529 from thatch45/event_cleaning

use event factory functions