Made the event handling more generic