event dispatcher refactoring (first pass)