move event listener to new file