adapter refactor