Simplified the diagnostics page code