Modular refactoring