Refactor property trees to ensure valid serialized documents.