created the structure plainObjectToNestedObject