adapter refactoring