In general, yes, I might use an LLM for a tedious refactor. In this case I might try <https://github.com/ast-grep/ast-grep> though.