Support "end" events through the pipe
Clean functions with possible semicolon endings