Extracted helper fn emit-event