diff --git a/Changes b/Changes
index ef06563..83ccfa9 100644
--- a/Changes
+++ b/Changes
@@ -1,5 +1,6 @@
-0.55.6 2016-06-03
+0.55.6 2016-06-08
         - [bugfix] distance with key "t" uses default foundry (diewald)
+	- [cleanup] Renamed fromJson() to fromKoral() (diewald)
 
 0.55.5 2016-05-02
 	- [performance] Changed to a dynamic window for sorting in FocusSpans (margaretha)
diff --git a/src/main/java/de/ids_mannheim/korap/Krill.java b/src/main/java/de/ids_mannheim/korap/Krill.java
index ad72f7a..964c10c 100644
--- a/src/main/java/de/ids_mannheim/korap/Krill.java
+++ b/src/main/java/de/ids_mannheim/korap/Krill.java
@@ -83,7 +83,7 @@
      *            The KoralQuery json string.
      */
     public Krill (String query) {
-        this.fromJson(query);
+        this.fromKoral(query);
     };
 
 
@@ -95,7 +95,7 @@
      *            The KoralQuery {@link JsonNode} object.
      */
     public Krill (JsonNode query) {
-        this.fromJson(query);
+        this.fromKoral(query);
     };
 
 
@@ -138,11 +138,11 @@
      * @return The {@link Krill} object for chaining.
      * @throws QueryException
      */
-    public Krill fromJson (final String query) {
+    public Krill fromKoral (final String query) {
         // Parse query string
         try {
             this.request = mapper.readTree(query);
-            this.fromJson(this.request);
+            this.fromKoral(this.request);
         }
 
         // Unable to parse JSON
@@ -162,7 +162,7 @@
      * @return The {@link Krill} object for chaining.
      * @throws QueryException
      */
-    public Krill fromJson (JsonNode json) {
+    public Krill fromKoral (JsonNode json) {
 
         // Parse "query" attribute
         if (json.has("query")) {
@@ -170,7 +170,7 @@
                 final KrillQuery kq = new KrillQuery("tokens");
                 this.setQuery(kq);
 
-                final SpanQueryWrapper qw = kq.fromJson(json.get("query"));
+                final SpanQueryWrapper qw = kq.fromKoral(json.get("query"));
 
                 // Throw an error, in case the query matches everywhere
                 if (qw.isEmpty())
@@ -215,7 +215,7 @@
 
                 // TODO: Temporary
                 if (collNode.fieldNames().hasNext()) {
-                    this.setCollection(new KrillCollection().fromJson(collNode));
+                    this.setCollection(new KrillCollection().fromKoral(collNode));
                 };
             }
 
diff --git a/src/main/java/de/ids_mannheim/korap/KrillCollection.java b/src/main/java/de/ids_mannheim/korap/KrillCollection.java
index ae09adc..36e9d5a 100644
--- a/src/main/java/de/ids_mannheim/korap/KrillCollection.java
+++ b/src/main/java/de/ids_mannheim/korap/KrillCollection.java
@@ -89,7 +89,7 @@
             JsonNode json = mapper.readTree(jsonString);
 
             if (json.has("collection"))
-                this.fromJson(json.get("collection"));
+                this.fromKoral(json.get("collection"));
 
             else if (json.has("collections"))
                 this.addError(899,
@@ -128,10 +128,10 @@
      *            The "collection" part of a KoralQuery.
      * @throws QueryException
      */
-    public KrillCollection fromJson (String jsonString) throws QueryException {
+    public KrillCollection fromKoral (String jsonString) throws QueryException {
         ObjectMapper mapper = new ObjectMapper();
         try {
-            this.fromJson((JsonNode) mapper.readTree(jsonString));
+            this.fromKoral((JsonNode) mapper.readTree(jsonString));
         }
         catch (Exception e) {
             this.addError(621, "Unable to parse JSON", "KrillCollection");
@@ -149,13 +149,13 @@
      *            as a {@link JsonNode} object.
      * @throws QueryException
      */
-    public KrillCollection fromJson (JsonNode json) throws QueryException {
+    public KrillCollection fromKoral (JsonNode json) throws QueryException {
         this.json = json;
-        return this.fromBuilder(this._fromJson(json));
+        return this.fromBuilder(this._fromKoral(json));
     };
 
 
-    private CollectionBuilder.Interface _fromJson (JsonNode json)
+    private CollectionBuilder.Interface _fromKoral (JsonNode json)
             throws QueryException {
 
         if (!json.has("@type")) {
@@ -282,7 +282,7 @@
                         "Unknown document group operation");
 
             for (JsonNode operand : json.get("operands")) {
-                group.with(this._fromJson(operand));
+                group.with(this._fromKoral(operand));
             };
             return group;
         }
diff --git a/src/main/java/de/ids_mannheim/korap/KrillQuery.java b/src/main/java/de/ids_mannheim/korap/KrillQuery.java
index b5ea08d..d12e473 100644
--- a/src/main/java/de/ids_mannheim/korap/KrillQuery.java
+++ b/src/main/java/de/ids_mannheim/korap/KrillQuery.java
@@ -44,7 +44,7 @@
  * String koral = "{\"@type\":"koral:group", ... }";
  * 
  * SpanQueryWrapper sqw = new
- * KrillQuery("tokens").fromJson("{... JsonString ...}");
+ * KrillQuery("tokens").fromKoral("{... JsonString ...}");
  * </pre></blockquote>
  * 
  * @author diewald
@@ -142,7 +142,7 @@
      * 
      * <blockquote><pre>
      * KrillQuery kq = new KrillQuery("tokens");
-     * SpanQueryWrapper sqw = kq.fromJson(
+     * SpanQueryWrapper sqw = kq.fromKoral(
      * "{\"@type\" : \"koral:token\","+
      * "\"wrap\" : {" +
      * "\"@type\" :   \"koral:term\"," +
@@ -159,7 +159,7 @@
      * @return {@link SpanQueryWrapper} object.
      * @throws QueryException
      */
-    public SpanQueryWrapper fromJson (String json) throws QueryException {
+    public SpanQueryWrapper fromKoral (String json) throws QueryException {
         JsonNode jsonN;
         try {
             // Read Json string
@@ -178,7 +178,7 @@
             jsonN = jsonN.get("query");
 
         // Deserialize from node
-        return this.fromJson(jsonN);
+        return this.fromKoral(jsonN);
     };
 
 
@@ -195,15 +195,15 @@
     // TODO: Use the shortcuts implemented in the builder
     //       instead of the wrapper constructors
     // TODO: Rename this span context!
-    public SpanQueryWrapper fromJson (JsonNode json) throws QueryException {
+    public SpanQueryWrapper fromKoral (JsonNode json) throws QueryException {
 
         // Set this for reserialization - may be changed later on
         this.json = json;
-        return this._fromJson(json);
+        return this._fromKoral(json);
     };
 
 
-    private SpanQueryWrapper _fromJson (JsonNode json) throws QueryException {
+    private SpanQueryWrapper _fromKoral (JsonNode json) throws QueryException {
         int number = 0;
 
         // Only accept @typed objects for the moment
@@ -278,7 +278,7 @@
                         log.trace("Wrap span reference {},{}", startOffset,
                                 length);
 
-                    SpanQueryWrapper sqw = this._fromJson(operands.get(0));
+                    SpanQueryWrapper sqw = this._fromKoral(operands.get(0));
                     SpanSubspanQueryWrapper ssqw = new SpanSubspanQueryWrapper(
                             sqw, startOffset, length);
                     return ssqw;
@@ -289,7 +289,7 @@
                     log.trace("Wrap class reference {}", number);
 
                 return new SpanFocusQueryWrapper(
-                        this._fromJson(operands.get(0)), number);
+                        this._fromKoral(operands.get(0)), number);
 
             case "koral:token":
 
@@ -476,7 +476,7 @@
         if (isReference) {
             JsonNode resolvedNode = _resolveReference(node, operands,
                     refOperandNum, classNum);
-            return new SpanReferenceQueryWrapper(this._fromJson(resolvedNode),
+            return new SpanReferenceQueryWrapper(this._fromKoral(resolvedNode),
                     (byte) classNum);
         }
 
@@ -539,8 +539,8 @@
                     "Number of operands is not acceptable");
         }
 
-        SpanQueryWrapper operand1 = this._fromJson(operands.get(0));
-        SpanQueryWrapper operand2 = this._fromJson(operands.get(1));
+        SpanQueryWrapper operand1 = this._fromKoral(operands.get(0));
+        SpanQueryWrapper operand2 = this._fromKoral(operands.get(1));
 
         String direction = ">:";
         if (operand1.isEmpty() && !operand2.isEmpty()) {
@@ -570,7 +570,7 @@
             throws QueryException {
         SpanAlterQueryWrapper ssaq = new SpanAlterQueryWrapper(this.field);
         for (JsonNode operand : operands) {
-            ssaq.or(this._fromJson(operand));
+            ssaq.or(this._fromKoral(operand));
         };
         return ssaq;
     };
@@ -662,8 +662,8 @@
         // </legacyCode>
 
         // Create SpanWithin Query
-        return new SpanWithinQueryWrapper(this._fromJson(operands.get(0)),
-                this._fromJson(operands.get(1)), flag);
+        return new SpanWithinQueryWrapper(this._fromKoral(operands.get(0)),
+                this._fromKoral(operands.get(1)), flag);
     };
 
 
@@ -712,7 +712,7 @@
         if (min > max)
             max = max;
 
-        SpanQueryWrapper sqw = this._fromJson(operands.get(0));
+        SpanQueryWrapper sqw = this._fromKoral(operands.get(0));
 
         if (sqw.maybeExtension())
             return sqw.setMin(min).setMax(max);
@@ -750,7 +750,7 @@
                     "Span references are currently not supported");
         };
 
-        return new SpanFocusQueryWrapper(this._fromJson(operands.get(0)),
+        return new SpanFocusQueryWrapper(this._fromKoral(operands.get(0)),
                 number);
     };
 
@@ -804,7 +804,7 @@
             };
 
             // Serialize operand
-            SpanQueryWrapper sqw = this._fromJson(operands.get(0));
+            SpanQueryWrapper sqw = this._fromKoral(operands.get(0));
 
             // Problematic
             if (sqw.maybeExtension())
@@ -823,7 +823,7 @@
 
         // Sequence with only one operand
         if (operands.size() == 1)
-            return this._fromJson(operands.get(0));
+            return this._fromKoral(operands.get(0));
 
         SpanSequenceQueryWrapper sseqqw = this.builder().seq();
 
@@ -945,7 +945,7 @@
 
         // Add segments to sequence
         for (JsonNode operand : operands) {
-            sseqqw.append(this._fromJson(operand));
+            sseqqw.append(this._fromKoral(operand));
         };
 
         // inOrder was set to false without a distance constraint
diff --git a/src/test/java/de/ids_mannheim/korap/TestSimple.java b/src/test/java/de/ids_mannheim/korap/TestSimple.java
index 9a42ab8..17179aa 100644
--- a/src/test/java/de/ids_mannheim/korap/TestSimple.java
+++ b/src/test/java/de/ids_mannheim/korap/TestSimple.java
@@ -96,7 +96,7 @@
 
         try {
             String json = getString(jsonFile);
-            sqwi = new KrillQuery("tokens").fromJson(json);
+            sqwi = new KrillQuery("tokens").fromKoral(json);
         }
         catch (QueryException e) {
             fail(e.getMessage());
diff --git a/src/test/java/de/ids_mannheim/korap/benchmark/TestBenchmarkSpans.java b/src/test/java/de/ids_mannheim/korap/benchmark/TestBenchmarkSpans.java
index e29c2b4..26874c4 100644
--- a/src/test/java/de/ids_mannheim/korap/benchmark/TestBenchmarkSpans.java
+++ b/src/test/java/de/ids_mannheim/korap/benchmark/TestBenchmarkSpans.java
@@ -383,7 +383,7 @@
 
         try {
             String json = getString(jsonFile);
-            sqwi = new KrillQuery("tokens").fromJson(json);
+            sqwi = new KrillQuery("tokens").fromKoral(json);
         }
         catch (QueryException e) {
             fail(e.getMessage());
diff --git a/src/test/java/de/ids_mannheim/korap/highlight/TestClass.java b/src/test/java/de/ids_mannheim/korap/highlight/TestClass.java
index c307e80..7b2bd7c 100644
--- a/src/test/java/de/ids_mannheim/korap/highlight/TestClass.java
+++ b/src/test/java/de/ids_mannheim/korap/highlight/TestClass.java
@@ -32,7 +32,7 @@
         String jsonPath = getClass().getResource("/queries/poly1.json")
                 .getFile();
         String jsonQuery = readFile(jsonPath);
-        SpanQueryWrapper sqwi = new KrillQuery("tokens").fromJson(jsonQuery);
+        SpanQueryWrapper sqwi = new KrillQuery("tokens").fromKoral(jsonQuery);
 
         SpanNextQuery sq = (SpanNextQuery) sqwi.toQuery();
         //System.out.println(sq.toString());
@@ -67,7 +67,7 @@
         String jsonPath = getClass().getResource("/queries/poly4.json")
                 .getFile();
         String jsonQuery = readFile(jsonPath);
-        SpanQueryWrapper sqwi = new KrillQuery("tokens").fromJson(jsonQuery);
+        SpanQueryWrapper sqwi = new KrillQuery("tokens").fromKoral(jsonQuery);
         SpanQuery sq = sqwi.toQuery();
 
         // System.out.println(sq.toString());
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestElementDistanceIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestElementDistanceIndex.java
index 17d9bf3..f63f299 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestElementDistanceIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestElementDistanceIndex.java
@@ -245,7 +245,6 @@
         assertEquals("[ec]ebdc", kr.getMatch(0).getSnippetBrackets());
     };
 
-
     public static String getString (String path) {
         StringBuilder contentBuilder = new StringBuilder();
         try {
@@ -268,7 +267,7 @@
 
         try {
             String json = getString(jsonFile);
-            sqwi = new KrillQuery("tokens").fromJson(json);
+            sqwi = new KrillQuery("tokens").fromKoral(json);
         }
         catch (QueryException e) {
             fail(e.getMessage());
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 73acd2a..91eab68 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestFieldDocument.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestFieldDocument.java
@@ -231,7 +231,7 @@
 
         try {
             String json = getString(jsonFile);
-            sqwi = new KrillQuery("tokens").fromJson(json);
+            sqwi = new KrillQuery("tokens").fromKoral(json);
         }
         catch (QueryException e) {
             fail(e.getMessage());
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestSpanExpansionIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestSpanExpansionIndex.java
index 5c2bc24..2a81f68 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestSpanExpansionIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestSpanExpansionIndex.java
@@ -299,7 +299,7 @@
         String jsonPath = getClass().getResource("/queries/poly3.json")
                 .getFile();
         String jsonQuery = readFile(jsonPath);
-        SpanQueryWrapper sqwi = new KrillQuery("tokens").fromJson(jsonQuery);
+        SpanQueryWrapper sqwi = new KrillQuery("tokens").fromKoral(jsonQuery);
 
         SpanQuery sq = sqwi.toQuery();
         //System.out.println(sq.toString());
@@ -409,7 +409,7 @@
         String json = readFile(getClass().getResource(
                 "/queries/bugs/expansion_bug_3.jsonld").getFile());
         KrillQuery kq = new KrillQuery("base");
-        SpanQuery sq = kq.fromJson(json).toQuery();
+        SpanQuery sq = kq.fromKoral(json).toQuery();
         assertEquals(
                 sq.toString(),
                 "focus(254: spanContain(<base:base/s:t />, {254: spanExpansion(base:s:c, []{0, 4}, right)}))");
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestWithinIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestWithinIndex.java
index 8ac224f..b0bd6cc 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestWithinIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestWithinIndex.java
@@ -1110,7 +1110,7 @@
         String jsonPath = getClass().getResource("/queries/poly2.json")
                 .getFile();
         String jsonPQuery = readFile(jsonPath);
-        SpanQueryWrapper sqwi = new KrillQuery("tokens").fromJson(jsonPQuery);
+        SpanQueryWrapper sqwi = new KrillQuery("tokens").fromKoral(jsonPQuery);
 
         SpanWithinQuery sq = (SpanWithinQuery) sqwi.toQuery();
 
@@ -1147,7 +1147,7 @@
         String jsonPath = getClass().getResource(
                 "/queries/bugs/span_or_bug.jsonld").getFile();
         String jsonPQuery = readFile(jsonPath);
-        SpanQueryWrapper sqwi = new KrillQuery("tokens").fromJson(jsonPQuery);
+        SpanQueryWrapper sqwi = new KrillQuery("tokens").fromKoral(jsonPQuery);
 
         SpanWithinQuery sq = (SpanWithinQuery) sqwi.toQuery();
 
diff --git a/src/test/java/de/ids_mannheim/korap/query/TestKrillQueryJSON.java b/src/test/java/de/ids_mannheim/korap/query/TestKrillQueryJSON.java
index cf8f67d..5e865d1 100644
--- a/src/test/java/de/ids_mannheim/korap/query/TestKrillQueryJSON.java
+++ b/src/test/java/de/ids_mannheim/korap/query/TestKrillQueryJSON.java
@@ -254,7 +254,7 @@
     @Test
     public void queryJSONDemo () throws QueryException {
         SpanQueryWrapper sqwi = new KrillQuery("tokens")
-                .fromJson("{ \"query\" : { \"@type\" : \"koral:token\", \"wrap\" : { \"@type\" : \"koral:term\", \"foundry\" : \"base\", \"layer\" : \"p\", \"key\" : \"foo\", \"match\" : \"match:eq\" }}}");
+                .fromKoral("{ \"query\" : { \"@type\" : \"koral:token\", \"wrap\" : { \"@type\" : \"koral:term\", \"foundry\" : \"base\", \"layer\" : \"p\", \"key\" : \"foo\", \"match\" : \"match:eq\" }}}");
 
         assertEquals(sqwi.toQuery().toString(), "tokens:base/p:foo");
     };
@@ -424,7 +424,7 @@
         try {
             String json = getString(getClass().getResource(
                     "/queries/bugs/underspecified_token.jsonld").getFile());
-            new KrillQuery("tokens").fromJson(json);
+            new KrillQuery("tokens").fromKoral(json);
         }
         catch (QueryException e) {
             assertEquals(701, e.getErrorCode());
@@ -495,21 +495,21 @@
             String json = getString(getClass().getResource(
                     "/queries/flags/unknown1.jsonld").getFile());
             KrillQuery kq = new KrillQuery("tokens");
-            assertEquals(kq.fromJson(json).toQuery().toString(),
+            assertEquals(kq.fromKoral(json).toQuery().toString(),
                     "tokens:s:buchstabe");
             assertEquals(kq.getWarning(0).getCode(), 748);
 
             json = getString(getClass().getResource(
                     "/queries/flags/unknown2.jsonld").getFile());
             kq = new KrillQuery("tokens");
-            assertEquals(kq.fromJson(json).toQuery().toString(),
+            assertEquals(kq.fromKoral(json).toQuery().toString(),
                     "tokens:i:buchstabe");
             assertEquals(kq.getWarning(0).getCode(), 748);
 
             json = getString(getClass().getResource(
                     "/queries/flags/unknown3.jsonld").getFile());
             kq = new KrillQuery("tokens");
-            assertEquals(kq.fromJson(json).toQuery().toString(),
+            assertEquals(kq.fromKoral(json).toQuery().toString(),
                     "tokens:i:buchstabe");
             assertEquals(kq.getWarning(0).getCode(), 748);
 
@@ -528,7 +528,7 @@
                     "/queries/element/simple-element.jsonld").getFile());
             KrillQuery kq = new KrillQuery("tokens");
 
-            assertEquals(kq.fromJson(json).toQuery().toString(),
+            assertEquals(kq.fromKoral(json).toQuery().toString(),
                     "<tokens:base/s:s />");
         }
         catch (QueryException e) {
@@ -546,7 +546,7 @@
             KrillQuery kq = new KrillQuery("tokens");
 
             assertEquals(
-                    kq.fromJson(json).toQuery().toString(),
+                    kq.fromKoral(json).toQuery().toString(),
                     "focus(254: spanContain(<tokens:base/s:t />, {254: spanExpansion(tokens:s:c, []{0, 4}, right)}))");
         }
         catch (QueryException e) {
@@ -563,7 +563,7 @@
                     "/queries/bugs/span_or_bug.jsonld").getFile());
             KrillQuery kq = new KrillQuery("tokens");
 
-            assertEquals(kq.fromJson(json).toQuery().toString(),
+            assertEquals(kq.fromKoral(json).toQuery().toString(),
                     "spanStartsWith(<tokens:base/s:s />, spanOr([tokens:s:Er, tokens:s:Sie]))");
         }
         catch (QueryException e) {
@@ -594,7 +594,7 @@
 
         try {
             String json = getString(jsonFile);
-            sqwi = new KrillQuery("tokens").fromJson(json);
+            sqwi = new KrillQuery("tokens").fromKoral(json);
         }
         catch (QueryException e) {
             fail(e.getMessage());
