abstract event handler