Refactored diagnostics