add serialization methods to some types