unit tests + EventDispatcher refactoring