Abstract refactoring