restructuring, event handling