Multistep refactoring