finish refactoring agent