refactoring of the adapter for something cleaner