better serialization of embedded documents