TL;DR

AI tends to generate the "path of least resistance" based on what dominates its training data and examples, not necessarily what is architecturally best for a long-lived codebase.

Knowing this, there are steps we can take as seasoned developers to improve the code in multiple passes (part 2).

"Amazing" AI Code?

So your non-technical friends have told you about creating a complete landing page in a few minutes! Everything works. They can modify, create, delete elements and AI executed each perfectly. And fast. They love the site, and will definitely create more pages/sites this way.