Refactor some files
Improved adapters