Moved event dispatching logic to new singleton object.