make serialization more flexible