imporove Emit().flatMap and Emit().append