Merge "Process output events in a separate function" into sc-dev