Perhaps, but you need to tell it how to refactor or you’ll get more gibberish and helper functions. Hence, programming.
if you tell it to do a thing it'll try it's best to make you think that it was done. I rarely get good refactors from AI unless I tell it specifically what to do.