Some more tidying of the document serializer class