cleanup of all handleEvent functions