improved spawn event serialization/deserialization