Remove explicit type in handleEvent