Cleanup and added a "catch all" event handler