move validation/encoding/decoding out of adapters and into the mapper