diff --git a/src/main/java/de/ids_mannheim/korap/index/FieldDocument.java b/src/main/java/de/ids_mannheim/korap/index/FieldDocument.java
index de988ed..8a91935 100644
--- a/src/main/java/de/ids_mannheim/korap/index/FieldDocument.java
+++ b/src/main/java/de/ids_mannheim/korap/index/FieldDocument.java
@@ -14,6 +14,7 @@
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.fasterxml.jackson.databind.JsonNode;
 import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.fasterxml.jackson.databind.node.ArrayNode;
 
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.TextField;
@@ -249,8 +250,13 @@
     /**
      * Deserialize koral:field types for meta data
      */
-    // Temporarily this needs to be in a "metaFields" parameter
-    public void setMetaFields (ArrayList<Map<String, JsonNode>> fields) {
+    public void setFields (ArrayList<Map<String, JsonNode>> fields) {
+        // Check if this is a token stream
+        if (!fields.get(0).containsKey("@type") && fields.get(0).containsKey("primaryData")) {
+            this.setLegacyFields(fields);        
+            return;
+        };
+        
         String type, key, value;
         StringBuffer sb = new StringBuffer();
         Iterator<JsonNode> i;
@@ -325,23 +331,27 @@
     /**
      * Deserialize token stream data (LEGACY).
      */
-    public void setFields (ArrayList<Map<String, Object>> fields) {
-        Map<String, Object> primary = fields.remove(0);
-        this.setPrimaryData((String) primary.get("primaryData"));
+    @JsonIgnore
+    private void setLegacyFields (ArrayList<Map<String, JsonNode>> fields) {
+        Map<String, JsonNode> primary = fields.remove(0);
+        this.setPrimaryData(primary.get("primaryData").asText());
 
-        for (Map<String, Object> field : fields) {
+        for (Map<String, JsonNode> field : fields) {
 
-            String fieldName = (String) field.get("name");
+            String fieldName = field.get("name").asText();
             MultiTermTokenStream mtts = this.newMultiTermTokenStream();
 
-            for (ArrayList<String> token : (ArrayList<ArrayList<String>>) field
-                    .get("data")) {
+            Iterator tokenIterator = field.get("data").elements();
+
+            while (tokenIterator.hasNext()) {
+                ArrayNode token = (ArrayNode) tokenIterator.next();
 
                 try {
-                    MultiTermToken mtt = new MultiTermToken(token.remove(0));
+                    MultiTermToken mtt = new MultiTermToken(token.remove(0).asText());
 
-                    for (String term : token) {
-                        mtt.add(term);
+                    Iterator<JsonNode> terms = token.elements();
+                    while (terms.hasNext()) {
+                        mtt.add(terms.next().asText());
                     };
 
                     mtts.addMultiTermToken(mtt);
@@ -349,16 +359,17 @@
                 catch (CorpusDataException cde) {
                     this.addError(cde.getErrorCode(), cde.getMessage());
                 };
-            };
 
+                
+            };
+            
             // TODO: This is normally dependend to the tokenization!
             //       Add this as meta information to the document
             // Store this information as well as tokenization information
             // as meta fields in the tokenization term vector
             if (field.containsKey("foundries")) {
                 // TODO: Do not store positions!
-                String foundries = (String) field.get("foundries");
-                this.addKeywords("foundries", foundries);
+                this.addKeywords("foundries", field.get("foundries").asText());
             };
 
             this.addTV(fieldName, this.getPrimaryData(), mtts);
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestFieldDocument.java b/src/test/java/de/ids_mannheim/korap/index/TestFieldDocument.java
index 009ef7e..af0dbdc 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestFieldDocument.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestFieldDocument.java
@@ -263,20 +263,16 @@
 
         String json = new String(
             "{"
+            + "  \"data\" : {"
+            + "    \"text\" : \"abc\","
+            + "    \"name\" : \"tokens\","
+            + "    \"stream\" : ["
+            + "       [ \"s:a\", \"i:a\", \"_0$<i>0<i>1\", \"-:t$<i>3\"],"
+            + "       [ \"s:b\", \"i:b\", \"_1$<i>1<i>2\" ],"
+            + "       [ \"s:c\", \"i:c\", \"_2$<i>2<i>3\" ]"
+            + "    ]"
+            + "  },"
             + "  \"fields\" : ["
-            + "    { "
-            + "      \"primaryData\" : \"abc\""
-            + "    },"
-            + "    {"
-            + "      \"name\" : \"tokens\","
-            + "      \"data\" : ["
-            + "         [ \"s:a\", \"i:a\", \"_0$<i>0<i>1\", \"-:t$<i>3\"],"
-            + "         [ \"s:b\", \"i:b\", \"_1$<i>1<i>2\" ],"
-            + "         [ \"s:c\", \"i:c\", \"_2$<i>2<i>3\" ]"
-            + "      ]"
-            + "    }"
-            + "  ],"
-            + "  \"metaFields\" : ["
             + "    {"
             + "      \"@type\" : \"koral:field\","
             + "      \"type\" : \"type:string\","
@@ -621,20 +617,16 @@
     private static String createDocString1 () {
         return new String(
             "{"
+            + "  \"data\" : {"
+            + "    \"text\" : \"abc\","
+            + "    \"name\" : \"tokens\","
+            + "    \"stream\" : ["
+            + "       [ \"s:a\", \"i:a\", \"_0$<i>0<i>1\", \"-:t$<i>3\"],"
+            + "       [ \"s:b\", \"i:b\", \"_1$<i>1<i>2\" ],"
+            + "       [ \"s:c\", \"i:c\", \"_2$<i>2<i>3\" ]"
+            + "    ]"
+            + "  },"
             + "  \"fields\" : ["
-            + "    { "
-            + "      \"primaryData\" : \"abc\""
-            + "    },"
-            + "    {"
-            + "      \"name\" : \"tokens\","
-            + "      \"data\" : ["
-            + "         [ \"s:a\", \"i:a\", \"_0$<i>0<i>1\", \"-:t$<i>3\"],"
-            + "         [ \"s:b\", \"i:b\", \"_1$<i>1<i>2\" ],"
-            + "         [ \"s:c\", \"i:c\", \"_2$<i>2<i>3\" ]"
-            + "      ]"
-            + "    }"
-            + "  ],"
-            + "  \"metaFields\" : ["
             + "    {"
             + "      \"@type\" : \"koral:field\","
             + "      \"type\" : \"type:string\","
