Factored out adapter.