Perhaps from this point instead of `text.length > 0` you could use `type === odf.OdfContainer.DocumentType.TEXT`, using `type` would at least make things more obvious in the later code lines