Added process-events helper func.