Refactoring of adapter