Some automatic refactoring