refactoring automation