Finished design of event listener and tests