Refactoring with abstracts