refactor: split _dispatch_event in two methods
#1008
Merged
_dispatch_event in two methods
#1008