abstract refactoring