abstract refactor