reorganized event listeners