Decoupled event dispatcher and adjusted unit tests.