Cleanup and consolidation of event listeners