diff --git a/examples/html-editor/index.js b/examples/html-editor/index.js
index 4b69b9c8..2d3b47f7 100644
--- a/examples/html-editor/index.js
+++ b/examples/html-editor/index.js
@@ -4,14 +4,14 @@ window.onload = function () {
   window.yXmlType.bindToDom(document.body)
 }
 
-let persistence = null //  new Y.IndexedDBPersistence()
+const persistence = new Y.IndexedDB()
 
 // initialize a shared object. This function call returns a promise!
-let y = new Y({
+let y = new Y('htmleditor', {
   connector: {
     name: 'websockets-client',
     url: 'http://127.0.0.1:1234',
-    room: 'x'
+    room: 'html-editor'
     // maxBufferLength: 100
   }
 }, persistence)
diff --git a/examples/indexeddb/index.js b/examples/indexeddb/index.js
index b307579b..9567497b 100644
--- a/examples/indexeddb/index.js
+++ b/examples/indexeddb/index.js
@@ -1,24 +1,18 @@
 /* global Y, CodeMirror */
 
-// initialize a shared object. This function call returns a promise!
-Y({
-  db: {
-    name: 'memory'
-  },
+const persistence = new Y.IndexedDB()
+const connector = {
   connector: {
     name: 'websockets-client',
     room: 'codemirror-example'
-  },
-  sourceDir: '/bower_components',
-  share: {
-    codemirror: 'Text' // y.share.codemirror is of type Y.Text
   }
-}).then(function (y) {
-  window.yCodeMirror = y
+}
+// initialize a shared object. This function call returns a promise!
+const y = Y('codemirror-example', connector, persistence)
+window.yCodeMirror = y
 
-  var editor = CodeMirror(document.querySelector('#codeMirrorContainer'), {
-    mode: 'javascript',
-    lineNumbers: true
-  })
-  y.share.codemirror.bindCodeMirror(editor)
+var editor = CodeMirror(document.querySelector('#codeMirrorContainer'), {
+  mode: 'javascript',
+  lineNumbers: true
 })
+y.share.codemirror.bindCodeMirror(editor)
diff --git a/examples/yjs-dist.mjs b/examples/yjs-dist.mjs
index 2544d0b4..885080bf 100644
--- a/examples/yjs-dist.mjs
+++ b/examples/yjs-dist.mjs
@@ -1,9 +1,9 @@
 
 import Y from '../src/Y.js'
 import yWebsocketsClient from '../../y-websockets-client/src/y-websockets-client.js'
-import IndexedDBPersistence from '../../y-indexeddb/src/y-indexeddb.js'
+import extendYIndexedDBPersistence from '../../y-indexeddb/src/y-indexeddb.js'
 
 Y.extend(yWebsocketsClient)
-Y.IndexedDBPersistence = IndexedDBPersistence
+extendYIndexedDBPersistence(Y)
 
 export default Y
diff --git a/src/Persistence.js b/src/Persistence.js
index c39352a9..d1fa95d4 100644
--- a/src/Persistence.js
+++ b/src/Persistence.js
@@ -25,24 +25,26 @@ export default class AbstractPersistence {
     if (cnf === undefined) {
       cnf = getFreshCnf()
       this.ys.set(y, cnf)
-      this.init(y)
-      y.on('afterTransaction', (y, transaction) => {
-        let cnf = this.ys.get(y)
-        if (cnf.len > 0) {
-          cnf.buffer.setUint32(0, cnf.len)
-          this.saveUpdate(y, cnf.buffer.createBuffer(), transaction)
-          let _cnf = getFreshCnf()
-          for (let key in _cnf) {
-            cnf[key] = _cnf[key]
+      return this.init(y).then(() => {
+        y.on('afterTransaction', (y, transaction) => {
+          let cnf = this.ys.get(y)
+          if (cnf.len > 0) {
+            cnf.buffer.setUint32(0, cnf.len)
+            this.saveUpdate(y, cnf.buffer.createBuffer(), transaction)
+            let _cnf = getFreshCnf()
+            for (let key in _cnf) {
+              cnf[key] = _cnf[key]
+            }
           }
-        }
+        })
+        return this.retrieve(y)
+      }).then(function () {
+        return Promise.resolve(cnf)
       })
-    }
-    return this.retrieve(y).then(function () {
+    } else {
       return Promise.resolve(cnf)
-    })
+    }
   }
-
   deinit (y) {
     this.ys.delete(y)
   }
diff --git a/src/Y.js b/src/Y.js
index 0ea68b78..41c43746 100644
--- a/src/Y.js
+++ b/src/Y.js
@@ -5,6 +5,7 @@ import { generateUserID } from './Util/generateUserID.js'
 import RootID from './Util/RootID.js'
 import NamedEventHandler from './Util/NamedEventHandler.js'
 import UndoManager from './Util/UndoManager.js'
+import { integrateRemoteStructs } from './MessageHandler/integrateRemoteStructs.js'
 
 import { messageToString, messageToRoomname } from './MessageHandler/messageToString.js'
 
@@ -192,7 +193,8 @@ Y.utils = {
   UndoManager,
   getRelativePosition,
   fromRelativePosition,
-  addType
+  addType,
+  integrateRemoteStructs
 }
 
 Y.debug = debug