Cleaned up HTMLDiff implementation for readability: