more generic event handler class