add unit tests and event listeners