I like to believe (it may not be true though), that the AI has learned what code actually exists in the wild, and is doing what all of us end up doing when trying to refactor a system we don't understand, writing new, similarish code as writing code is more fun than reading it.