Refactoring method autogeneration