Move helper methods to ProcessDiagnostics