ai refactoring pitfalls