refactored adapter