Move code out into the adapters