Improve listener registration.
Moved addListeners to the client part of the application.