Refactored event dispatching to use an array.