Folding in some of Adrian's changes to create a complex object and create a simple object documents