big refactoring and implement adapters