factor out generateEvent for steps