Clean up event handlers for better garbage collection