diff --git a/declarations/Structs.js b/declarations/Structs.js
index 9855efeb3cf5735fa42121ca8e41822f98ac0414..9821209364d84abf44d92467ad012e54a2136ccd 100644
--- a/declarations/Structs.js
+++ b/declarations/Structs.js
@@ -17,7 +17,12 @@ type Operation = Struct
 type Insertion = {
   id: Id,
   left: Id,
+  origin: Id,
   right: Id,
+  parent: Id,
+  parentSub: ?Id,
+  opContent: ?Id,
+  content: ?any,
   struct: 'Insert'
 }
 
diff --git a/declarations/Y.js b/declarations/Y.js
index 7a4bd94f809b25c99af1260c32ace059552dfb22..394a6a9982819fd5904435594de7c82e249dfdf3 100644
--- a/declarations/Y.js
+++ b/declarations/Y.js
@@ -1,10 +1,10 @@
 /* @flow */
 
 type YGlobal = {
-	utils: Object;
-	Struct: Object;
-	AbstractDatabase: any;
-	AbstractConnector: any;
+	utils: Object,
+	Struct: any,
+	AbstractDatabase: any,
+	AbstractConnector: any
 }
 
 type YConfig = {
diff --git a/src/Connector.js b/src/Connector.js
index a1bef56f3307638b50c478f65951c3ce416364d2..1c4e6b47dafc32bf70bc8d160ab82406c26a8a64 100644
--- a/src/Connector.js
+++ b/src/Connector.js
@@ -11,7 +11,7 @@ module.exports = function (Y/* :YGlobal */) {
     userEventListeners: Array<Function>;
     whenSyncedListeners: Array<Function>;
     currentSyncTarget: ?UserId;
-    syncingClients: Array<any>;
+    syncingClients: Array<UserId>;
     forwardToSyncingClients: boolean;
     debug: boolean;
     broadcastedHB: boolean;
diff --git a/src/Struct.js b/src/Struct.js
index f8cc40ba99813b6c5fb6b6a17d0fa443381b4744..c4b38d471b255a976fece5710f6ce5b2e253a586 100644
--- a/src/Struct.js
+++ b/src/Struct.js
@@ -1,3 +1,4 @@
+/* @flow */
 'use strict'
 
 /*
@@ -18,7 +19,7 @@
  * requiredOps
      - Operations that are required to execute this operation.
 */
-module.exports = function (Y) {
+module.exports = function (Y/* :YGlobal */) {
   var Struct = {
     /* This is the only operation that is actually not a structure, because
     it is not stored in the OS. This is why it _does not_ have an id
@@ -49,10 +50,10 @@ module.exports = function (Y) {
           parentSub: string (optional), // child of Map type
         }
       */
-      encode: function (op) {
+      encode: function (op/* :Insertion */) /* :Insertion */ {
         // TODO: you could not send the "left" property, then you also have to
         // "op.left = null" in $execute or $decode
-        var e = {
+        var e/* :any */ = {
           id: op.id,
           left: op.left,
           right: op.right,
@@ -160,7 +161,11 @@ module.exports = function (Y) {
               break
             }
             i++
-            o = o.right ? yield* this.getOperation(o.right) : null
+            if (o.right != null) {
+              o = yield* this.getOperation(o.right)
+            } else {
+              o = null
+            }
           } else {
             break
           }
@@ -169,7 +174,9 @@ module.exports = function (Y) {
         // reconnect..
         var left = null
         var right = null
-        parent = parent || (yield* this.getOperation(op.parent))
+        if (parent == null) {
+          parent = yield* this.getOperation(op.parent)
+        }
 
         // reconnect left and set right of op
         if (op.left != null) {
@@ -267,7 +274,7 @@ module.exports = function (Y) {
             pos--
           }
           if (pos >= 0 && o.right != null) {
-            o = (yield* this.getOperation(o.right))
+            o = yield* this.getOperation(o.right)
           } else {
             break
           }
@@ -315,19 +322,13 @@ module.exports = function (Y) {
         var oid = op.map[name]
         if (oid != null) {
           var res = yield* this.getOperation(oid)
-          return (res == null || res.deleted) ? void 0 : (res.opContent == null
-            ? res.content : yield* this.getType(res.opContent))
-        }
-      },
-      /*
-        Delete a property by name
-      */
-      delete: function * (op, name) {
-        var v = op.map[name] || null
-        if (v != null) {
-          yield* Struct.Delete.create.call(this, {
-            target: v
-          })
+          if (res == null || res.deleted) {
+            return void 0
+          } else if (res.opContent == null) {
+            return res.content
+          } else {
+            return yield* this.getType(res.opContent)
+          }
         }
       }
     }