move serialization into adapter