Move adaptor_*() functions into their own header