Moved all event listeners to separate file