New event unmarshalling code