Refactored to one event listener

Closes #1