move adapters to middleware