diff --git a/Changes b/Changes
index d8c8592..c54c996 100644
--- a/Changes
+++ b/Changes
@@ -1,4 +1,10 @@
-0.49.4 2015-02-13
+0.50.1 2015-02-23
+	- Deserialization of arbitrary elements with attributes (margaretha)
+
+0.50 2015-02-23
+        - Project name is now "Krill"
+
+0.49.4 2015-02-20
         - [documentation] Improved documentation for API classes,
 	  improved test coverage for utility classes (diewald)
    	- [performance] Updated Lucene dependency from 4.5.1 to 4.10.3,
diff --git a/pom.xml b/pom.xml
index cdbbbd6..2659c86 100644
--- a/pom.xml
+++ b/pom.xml
@@ -7,7 +7,7 @@
       # install the indexer
       $ mvn clean compile assembly:single
       # Then run e.g.
-      $ java -jar target/KorAP-lucene-index-X.XX.jar
+      $ java -jar target/Krill-X.XX.jar
              src/main/resources/korap.conf
              /data/hdd/lucene-new/WPD/
 
@@ -22,11 +22,11 @@
   -->
 
   <groupId>KorAP-modules</groupId>
-  <artifactId>KorAP-lucene-index</artifactId>
-  <version>0.49.4</version>
+  <artifactId>Krill</artifactId>
+  <version>0.50.1</version>
   <packaging>jar</packaging>
 
-  <name>KorAP-lucene-index</name>
+  <name>Krill</name>
   <url>http://www.ids-mannheim.de/</url>
 
   <organization>
@@ -148,9 +148,28 @@
     </dependency>
 
     <!-- JSON support in Jersey -->
+    <!--
+	<dependency>
+	<groupId>org.glassfish.jersey.media</groupId>
+	<artifactId>jersey-media-moxy</artifactId>
+	</dependency>
     <dependency>
-      <groupId>org.glassfish.jersey.media</groupId>
-      <artifactId>jersey-media-moxy</artifactId>
+      <groupId>com.sun.jersey</groupId>
+      <artifactId>jersey-json</artifactId>
+      <version>1.9</version>
+    </dependency>
+    -->
+    <!--
+	<dependency>
+	<groupId>org.glassfish.jersey.media</groupId>
+	<artifactId>jersey-media-json-jackson</artifactId>
+	<version>2.16</version>
+	</dependency>
+    -->
+    <dependency>
+      <groupId>com.fasterxml.jackson.jaxrs</groupId>
+      <artifactId>jackson-jaxrs-json-provider</artifactId>
+      <version>2.4.4</version>
     </dependency>
 
     <!-- JSON support using Jackson -->
diff --git a/src/main/java/de/ids_mannheim/korap/KorapIndex.java b/src/main/java/de/ids_mannheim/korap/KorapIndex.java
index 6f9130b..a800f54 100644
--- a/src/main/java/de/ids_mannheim/korap/KorapIndex.java
+++ b/src/main/java/de/ids_mannheim/korap/KorapIndex.java
@@ -835,7 +835,7 @@
                     log.trace("We've found a matching document");
 
                 HashSet<String> fields = (HashSet<String>)
-                    new KorapSearch().getFields().clone();
+                    new Krill().getFields().clone();
                 fields.add(field);
 
                 // Get terms from the document
@@ -1076,13 +1076,13 @@
      * Search in the index.
      */
     public KorapResult search (SpanQuery query) {
-        return this.search(new KorapSearch(query));
+        return this.search(new Krill(query));
     };
 
 
     public KorapResult search (SpanQuery query, short count) {
         return this.search(
-            new KorapSearch(query).setCount(count)
+            new Krill(query).setCount(count)
         );
     };
 
@@ -1096,7 +1096,7 @@
                                boolean rightTokenContext,
                                short rightContext) {
 
-        KorapSearch ks = new KorapSearch(query);
+        Krill ks = new Krill(query);
         ks.setStartIndex(startIndex).setCount(count);
         ks.setContext(
             new SearchContext(
@@ -1119,7 +1119,7 @@
                                short leftContext,
                                boolean rightTokenContext,
                                short rightContext) {
-        KorapSearch ks = new KorapSearch(query);
+        Krill ks = new Krill(query);
         ks.setContext(
             new SearchContext(
                 leftTokenContext,
@@ -1136,7 +1136,7 @@
     /**
      * Search the endpoint.
      */
-    public KorapResult search (KorapSearch ks) {
+    public KorapResult search (Krill ks) {
         if (DEBUG)
             log.trace("Start search");
 
@@ -1145,7 +1145,7 @@
         KorapCollection collection = ks.getCollection();
         collection.setIndex(this);
 
-        // Get the spanquery from the KorapSearch object
+        // Get the spanquery from the Krill object
         SpanQuery query = ks.getSpanQuery();
 
         // Get the field of textual data and annotations ("tokens")
@@ -1376,7 +1376,7 @@
 
 
     // Collect matches
-    public MatchCollector collect (KorapSearch ks, MatchCollector mc) {
+    public MatchCollector collect (Krill ks, MatchCollector mc) {
         if (DEBUG)
             log.trace("Start collecting");
 
diff --git a/src/main/java/de/ids_mannheim/korap/KorapNode.java b/src/main/java/de/ids_mannheim/korap/KorapNode.java
index 8c34dd0..ddaab00 100644
--- a/src/main/java/de/ids_mannheim/korap/KorapNode.java
+++ b/src/main/java/de/ids_mannheim/korap/KorapNode.java
@@ -34,13 +34,13 @@
     // Index
     private static KorapIndex index;
     private static ComboPooledDataSource cpds;
-    private static String path;
-    private static String name = "unknown";
+    private static String path,
+                          name = "unknown";
 
     private static String dbUser, dbPwd;
 
-    private static String dbClass = "org.sqlite.JDBC";
-    private static String dbURL   = "jdbc:sqlite:";
+    private static String dbClass = "org.sqlite.JDBC",
+                          dbURL   = "jdbc:sqlite:";
     
     /*
      * Todo: Add shutdown hook,
@@ -50,7 +50,9 @@
      */
 
     /**
-     * Starts Grizzly HTTP server exposing JAX-RS resources defined in this application.
+     * Starts Grizzly HTTP server exposing JAX-RS
+     * resources defined in this application.
+     *
      * @return Grizzly HTTP server.
      */
     public static HttpServer startServer() {
@@ -112,7 +114,7 @@
      * @param args
      * @throws IOException
      */
-    public static void main(String[] args) throws IOException {
+    public static void main (String[] args) throws IOException {
         // WADL available at BASE_URI + application.wadl
 
         final HttpServer server = startServer();
diff --git a/src/main/java/de/ids_mannheim/korap/KorapQuery.java b/src/main/java/de/ids_mannheim/korap/KorapQuery.java
index d2a1660..f3b499e 100644
--- a/src/main/java/de/ids_mannheim/korap/KorapQuery.java
+++ b/src/main/java/de/ids_mannheim/korap/KorapQuery.java
@@ -71,7 +71,8 @@
 */
 public class KorapQuery extends Notifications {
     private String field;
-    private ObjectMapper json;
+    private ObjectMapper mapper;
+    private JsonNode json;
 
     // Logger
     private final static Logger log = LoggerFactory.getLogger(KorapQuery.class);
@@ -98,7 +99,7 @@
      */
     public KorapQuery (String field) {
         this.field = field;
-        this.json = new ObjectMapper();
+        this.mapper = new ObjectMapper();
     };
 
 
@@ -159,7 +160,7 @@
         JsonNode jsonN;
         try {
             // Read Json string
-            jsonN = this.json.readValue(json, JsonNode.class);
+            jsonN = this.mapper.readValue(json, JsonNode.class);
         }
 
         // Something went wrong
@@ -194,6 +195,9 @@
         if (!json.has("@type"))
             throw new QueryException(701, "JSON-LD group has no @type attribute");
 
+        // Set this for serialization
+        this.json = json;
+
         // Get @type for branching
         String type = json.get("@type").asText();
 
@@ -1078,8 +1082,17 @@
             }
         }
 		return null;
-    }
+    };
 
+    public JsonNode toJsonNode () {
+        return this.json;
+    };
+
+    public String toJsonString () {
+        if (this.json == null)
+            return "{}";
+        return this.json.toString();
+    };
 
 
     /*
diff --git a/src/main/java/de/ids_mannheim/korap/KorapResult.java b/src/main/java/de/ids_mannheim/korap/KorapResult.java
index 8f4c1dc..18c6cdd 100644
--- a/src/main/java/de/ids_mannheim/korap/KorapResult.java
+++ b/src/main/java/de/ids_mannheim/korap/KorapResult.java
@@ -19,7 +19,7 @@
 import java.util.List;
 
 /*
-  TODO: Reuse the KorapSearch code for data serialization!
+  TODO: Reuse the Krill code for data serialization!
 */
 /**
  * Response class for search results.
@@ -31,7 +31,7 @@
  */
 @JsonInclude(Include.NON_NULL)
 @JsonIgnoreProperties(ignoreUnknown = true)
-public class KorapResult extends KorapResponse {
+public class KorapResult extends Krill {
     ObjectMapper mapper = new ObjectMapper();
 
     @JsonIgnore
diff --git a/src/main/java/de/ids_mannheim/korap/KorapSearch.java b/src/main/java/de/ids_mannheim/korap/Krill.java
similarity index 71%
rename from src/main/java/de/ids_mannheim/korap/KorapSearch.java
rename to src/main/java/de/ids_mannheim/korap/Krill.java
index 1021bb0..c168f3b 100644
--- a/src/main/java/de/ids_mannheim/korap/KorapSearch.java
+++ b/src/main/java/de/ids_mannheim/korap/Krill.java
@@ -10,11 +10,14 @@
 import de.ids_mannheim.korap.KorapResult;
 import de.ids_mannheim.korap.util.QueryException;
 import de.ids_mannheim.korap.index.SearchContext;
-import de.ids_mannheim.korap.response.Notifications;
+import de.ids_mannheim.korap.response.KorapResponse;
 
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.fasterxml.jackson.databind.JsonNode;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 /**
  * Krill is a corpus data retrieval index using Lucene for Look-Ups.
  * It is the reference implementation for KoralQuery consumption.
@@ -33,17 +36,14 @@
 /*
  * Todo: Use a configuration file
  * Todo: Let this class extend KorapResult!
- *   KorapResult = new KorapSearch(String json).run(KorapIndex ki);
+ *   KorapResult = new Krill(String json).run(KorapIndex ki);
  * Todo: Set timeout default value per config file
  */
-
-public class KorapSearch extends Notifications {
+public class Krill extends KorapResponse {
     private int startIndex = 0, limit = 0;
     private short count = 25, countMax = 50, itemsPerResource = 0;
     private boolean cutOff = false;
 
-    private SpanQuery spanQuery;
-
     private KorapCollection collection;
     private KorapIndex index;
 
@@ -51,8 +51,9 @@
     private long timeout = (long) 120_000;
 
     private HashSet<String> fields;
-    private HashSet<Integer> highlights;
+            HashSet<Integer> highlights;
 
+    private SpanQuery spanQuery;
     private JsonNode request;
 
     public SearchContext context;
@@ -60,12 +61,15 @@
 
     private long timeoutStart = Long.MIN_VALUE;
 
+    // Logger
+    private final static Logger log = LoggerFactory.getLogger(Krill.class);
+
     {
         context  = new SearchContext();
 
         fields = new HashSet<String>(16);
 
-        // Lift legacy fields per default
+        // LEGACY: Lift following fields per default
         for (String field : new String[]{
                 "ID",
                 "UID",
@@ -87,11 +91,11 @@
         highlights = new HashSet<Integer>(3);
     };
 
-
+    
     /**
      * Construct a new Krill object.
      */
-    public KorapSearch () {};
+    public Krill () {};
 
 
     /**
@@ -100,7 +104,7 @@
      *
      * @param query The {@link SpanQueryWrapper} object.
      */
-    public KorapSearch (SpanQueryWrapper query) {
+    public Krill (SpanQueryWrapper query) {
         try {
             this.spanQuery = query.toQuery();
         }
@@ -116,37 +120,72 @@
      *
      * @param query The {@link SpanQuery} object.
      */
-    public KorapSearch (SpanQuery query) {
+    public Krill (SpanQuery query) {
         this.spanQuery = query;
     };
 
 
-    public KorapSearch (String jsonString) {
-        try {
-            // Parse json string
-            this.fromJson(jsonString);
-        }
-        catch (QueryException qe) {
-            this.addError(qe.getErrorCode(), qe.getMessage());
-        };
-    };
-
-    public KorapSearch (JsonNode json) {
-        try {
-            this.fromJson(json);
-        }
-        catch (QueryException qe) {
-            this.addError(qe.getErrorCode(), qe.getMessage());
-        };
+    /**
+     * Construct a new Krill object,
+     * consuming a KoralQuery json string.
+     *
+     * @param query The KoralQuery json string.
+     */
+    public Krill (String query) {
+        // Parse json string
+        this.fromJson(query);
     };
 
 
-    public KorapSearch fromJson (JsonNode json) throws QueryException {
+    /**
+     * Construct a new Krill object,
+     * consuming a KoralQuery {@link JsonNode} object.
+     *
+     * @param query The KoralQuery {@link JsonNode} object.
+     */
+    public Krill (JsonNode query) {
+        this.fromJson(query);
+    };
+
+
+    /**
+     * Parse KoralQuery as a json string.
+     *
+     * @param query The KoralQuery json string.
+     * @return The {@link Krill} object for chaining.
+     * @throws QueryException
+     */
+    public Krill fromJson (String query) {
+        ObjectMapper mapper = new ObjectMapper();
+        try {
+            this.request = mapper.readTree(query);
+            this.fromJson(this.request);
+        }
+
+        // Unable to parse JSON
+        catch (IOException e) {
+            this.addError(621, "Unable to parse JSON");
+        };
+
+        return this;
+    };
+
+
+    /**
+     * Parse KoralQuery as a {@link JsonNode} object.
+     *
+     * @param query The KoralQuery {@link JsonNode} object.
+     * @return The {@link Krill} object for chaining.
+     * @throws QueryException
+     */
+    public Krill fromJson (JsonNode json) {
+
         // Parse "query" attribute
         if (json.has("query")) {
             try {
                 KorapQuery kq = new KorapQuery("tokens");
                 SpanQueryWrapper qw = kq.fromJson(json.get("query"));
+                this.setQuery(kq);
 
                 // Unable to process result
                 if (qw.isEmpty())
@@ -166,8 +205,9 @@
                 this.addError(q.getErrorCode(), q.getMessage());
             };
         }
-        else
+        else {
             this.addError(700, "No query given");
+        };
 
         // <legacycode>
         if (json.has("warning") &&
@@ -189,22 +229,27 @@
         this.copyNotificationsFrom(json);
 	    
         // virtual collections
-        if (json.has("collection")) {
-            this.setCollection(
-                new KorapCollection().fromJson(json.get("collection"))
-            );
-        }
+        try {
+            if (json.has("collection")) {
+                this.setCollection(
+                    new KorapCollection().fromJson(json.get("collection"))
+                );
+            }
 
-        // <legacycode>
-        else if (json.has("collections")) {
-            KorapCollection kc = new KorapCollection();
-            for (JsonNode collection : json.get("collections")) {
-                kc.fromJsonLegacy(collection);
+            // <legacycode>
+            else if (json.has("collections")) {
+                KorapCollection kc = new KorapCollection();
+                for (JsonNode collection : json.get("collections")) {
+                    kc.fromJsonLegacy(collection);
+                };
+                
+                this.setCollection(kc);
             };
-
-            this.setCollection(kc);
+            // </legacycode>
+        }
+        catch (QueryException q) {
+            this.addError(q.getErrorCode(), q.getMessage());
         };
-        // </legacycode>
 
 
         // No errors
@@ -277,23 +322,6 @@
         return this;
     };
 
-
-    public KorapSearch fromJson (String jsonString) throws QueryException {
-        ObjectMapper mapper = new ObjectMapper();
-        try {
-            this.request = mapper.readTree(jsonString);
-            this.fromJson(this.request);
-        }
-
-        // Unable to parse JSON
-        catch (IOException e) {
-            this.addError(621, "Unable to parse JSON");
-        };
-
-        return this;
-    };
-
-
     public long getTimeOut () {
         return this.timeout;
     };
@@ -302,35 +330,17 @@
         this.timeout = timeout;
     };
 
-    public SpanQuery getSpanQuery () {
-        return this.spanQuery;
-    };
 
     public JsonNode getRequest () {
         return this.request;
     };
 
-    public KorapSearch setSpanQuery (SpanQueryWrapper sqwi) {
-        // this.copyNotifications(sqwi);
-        try {
-            this.spanQuery = sqwi.toQuery();
-        }
-        catch (QueryException q) {
-            this.addError(q.getErrorCode(), q.getMessage());
-        };
-        return this;
-    };
-
-    public KorapSearch setSpanQuery (SpanQuery sq) {
-        this.spanQuery = sq;
-        return this;
-    };
 
     public SearchContext getContext () {
         return this.context;
     };
 
-    public KorapSearch setContext (SearchContext context) {
+    public Krill setContext (SearchContext context) {
         this.context = context;
         return this;
     };
@@ -339,12 +349,12 @@
         return this.startIndex;
     };
     
-    public KorapSearch setStartIndex (int value) {
+    public Krill setStartIndex (int value) {
         this.startIndex = (value >= 0) ? value : 0;
         return this;
     };
 
-    public KorapSearch setStartPage (int value) {
+    public Krill setStartPage (int value) {
         if (value >= 0)
             this.setStartIndex((value * this.getCount()) - this.getCount());
         else
@@ -364,7 +374,7 @@
         return this.limit;
     };
 
-    public KorapSearch setLimit (int limit) {
+    public Krill setLimit (int limit) {
         if (limit > 0)
             this.limit = limit;
         return this;
@@ -374,30 +384,30 @@
         return this.cutOff;
     };
 
-    public KorapSearch setCutOff (boolean cutOff) {
+    public Krill setCutOff (boolean cutOff) {
         this.cutOff = cutOff;
         return this;
     };
 
-    public KorapSearch setCount (int value) {
+    public Krill setCount (int value) {
         // Todo: Maybe update startIndex with known startPage!
         this.setCount((short) value);
         return this;
     };
 
-    public KorapSearch setCount (short value) {
+    public Krill setCount (short value) {
         if (value > 0)
             this.count = (value <= this.countMax) ? value : this.countMax;
         return this;
     };
 
-    public KorapSearch setItemsPerResource (short value) {
+    public Krill setItemsPerResource (short value) {
         if (value >= 0)
             this.itemsPerResource = value;
         return this;
     };
 
-    public KorapSearch setItemsPerResource (int value) {
+    public Krill setItemsPerResource (int value) {
         return this.setItemsPerResource((short) value);
     };
 
@@ -419,9 +429,9 @@
      * Add a field to the set of fields to retrieve.
      *
      * @param field The field to retrieve.
-     * @return The {@link KorapSearch} object for chaining.
+     * @return The {@link Krill} object for chaining.
      */
-    public KorapSearch addField (String field) {
+    public Krill addField (String field) {
         this.fields.add(field);
         return this;
     };
@@ -431,15 +441,15 @@
      * Add class numbers to highlight in KWIC view.
      *
      * @param classNumber The number of a class to highlight.
-     * @return The {@link KorapSearch} object for chaining.
+     * @return The {@link Krill} object for chaining.
      */
-    public KorapSearch addHighlight (int classNumber) {
+    public Krill addHighlight (int classNumber) {
         this.highlights.add(classNumber);
         return this;
     };
 
 
-    public KorapSearch setCollection (KorapCollection kc) {
+    public Krill setCollection (KorapCollection kc) {
         this.collection = kc;
         
         // Move messages from the collection
@@ -455,35 +465,84 @@
     };
 
 
+    public KorapIndex getIndex () {
+        return this.index;
+    };
+
+    public Krill setIndex (KorapIndex ki) {
+        this.index = ki;
+        return this;
+    };
+
+
     /**
      * Apply the KoralQuery to an index.
+     *
+     * @param index The {@link KorapIndex}
+     *        the search should be applyied to.
+     * @return The result as a {@link KorapResult} object.
      */
-    public KorapResult apply (KorapIndex ki) {
-        if (this.spanQuery == null) {
-            KorapResult kr = new KorapResult();
-            kr.setRequest(this.request);
+    public KorapResult apply (KorapIndex index) {
+        return this.setIndex(index).apply();
+    };
 
-            if (this.hasErrors())
-                kr.copyNotificationsFrom(this);
-            else
-                kr.addError(700, "No query given");
-            return kr;
-        };
 
+    /**
+     * Apply the KoralQuery to an index.
+     *
+     * @return The result as a {@link KorapResult} object.
+     */
+    public KorapResult apply () {
+
+        // Create new KorapResult object to return
+        KorapResult kr = new KorapResult();
+
+        // There were errors
         if (this.hasErrors()) {
-            KorapResult kr = new KorapResult();
-
-            // TODO: dev mode
-            kr.setRequest(this.request);
             kr.copyNotificationsFrom(this);
-            return kr;
+        }
+
+        // There was no index
+        else if (this.index == null) {
+            kr.addError(601, "Unable to find index");
+        }
+
+        // Apply search
+        else {
+            kr = this.index.search(this);
+            this.getCollection().setIndex(this.index);
+            kr.copyNotificationsFrom(this);
         };
 
-        this.getCollection().setIndex(ki);
-        KorapResult kr = ki.search(this);
+        // TODO: Only for development mode
         kr.setRequest(this.request);
-        kr.copyNotificationsFrom(this);
-        this.clearNotifications();
+        kr.setQuery(this.getQuery());
+
         return kr;
     };
+
+    @Deprecated
+    public SpanQuery getSpanQuery () {
+        return this.spanQuery;
+    };
+
+
+    @Deprecated
+    public Krill setSpanQuery (SpanQueryWrapper sqwi) {
+        // this.copyNotifications(sqwi);
+        try {
+            this.spanQuery = sqwi.toQuery();
+        }
+        catch (QueryException q) {
+            this.addError(q.getErrorCode(), q.getMessage());
+        };
+        return this;
+    };
+
+
+    @Deprecated
+    public Krill setSpanQuery (SpanQuery sq) {
+        this.spanQuery = sq;
+        return this;
+    };
 };
diff --git a/src/main/java/de/ids_mannheim/korap/node/Resource.java b/src/main/java/de/ids_mannheim/korap/node/Resource.java
index bc70cd1..0bdcc23 100644
--- a/src/main/java/de/ids_mannheim/korap/node/Resource.java
+++ b/src/main/java/de/ids_mannheim/korap/node/Resource.java
@@ -22,7 +22,7 @@
 
 import de.ids_mannheim.korap.KorapNode;
 import de.ids_mannheim.korap.KorapIndex;
-import de.ids_mannheim.korap.KorapSearch;
+import de.ids_mannheim.korap.Krill;
 import de.ids_mannheim.korap.KorapCollection;
 import de.ids_mannheim.korap.KorapMatch;
 import de.ids_mannheim.korap.KorapResult;
@@ -62,6 +62,9 @@
     // Initiate Logger
     private final static Logger log = LoggerFactory.getLogger(KorapNode.class);
 
+    // This advices the java compiler to ignore all loggings
+    public static final boolean DEBUG = false;
+
     // Slightly based on String::BooleanSimple
     static Pattern p = Pattern.compile(
         "\\s*(?i:false|no|inactive|disabled|off|n|neg(?:ative)?|not|null|undef)\\s*"
@@ -69,14 +72,14 @@
 
     // Check if a string is meant to represent null
     private static boolean isNull (String value) {
-	if (value == null)
-	    return true;
+        if (value == null)
+            return true;
 
-	Matcher m = p.matcher(value);
-	if (m.matches())
-	    return true;
+        Matcher m = p.matcher(value);
+        if (m.matches())
+            return true;
 
-	return false;
+        return false;
     };
 
 
@@ -86,22 +89,22 @@
     @GET
     @Produces(MediaType.APPLICATION_JSON)
     public String info () {
-	KorapIndex index = KorapNode.getIndex();
-	KorapResponse kresp = new KorapResponse();
-	kresp.setNode(KorapNode.getName());
-	kresp.setName(index.getName());
-	kresp.setVersion(index.getVersion());
+        KorapIndex index = KorapNode.getIndex();
+        KorapResponse kresp = new KorapResponse();
+        kresp.setNode(KorapNode.getName());
+        kresp.setName(index.getName());
+        kresp.setVersion(index.getVersion());
 
-	kresp.setListener(KorapNode.getListener());
-	long texts = -1;
-	/*
-	kresp.addMessage(
-	    "Number of documents in the index",
-	    String.parseLong(index.numberOf("documents"))
-	);
-	*/
-	kresp.addMessage(680, "Server is up and running!");
-	return kresp.toJsonString();
+        kresp.setListener(KorapNode.getListener());
+        long texts = -1;
+        /*
+          kresp.addMessage(
+          "Number of documents in the index",
+          String.parseLong(index.numberOf("documents"))
+          );
+        */
+        kresp.addMessage(680, "Server is up and running!");
+        return kresp.toJsonString();
     };
     
 
@@ -120,44 +123,50 @@
     @Produces(MediaType.APPLICATION_JSON)
     @Consumes(MediaType.APPLICATION_JSON)
     public String add (@PathParam("textID") Integer uid,
-		       @Context UriInfo uri,
-		       String json) {
-	/*
-	 * See
-	 * http://www.mkyong.com/webservices/jax-rs/file-upload-example-in-jersey/
-	 */
+                       @Context UriInfo uri,
+                       String json) {
+        /*
+         * See
+         * http://www.mkyong.com/webservices/jax-rs/file-upload-example-in-jersey/
+         */
 
-	// Todo: Parameter for server node
+        // Todo: Parameter for server node
 
-	// Get index
-	KorapIndex index = KorapNode.getIndex();
+        if (DEBUG)
+            log.trace("Added new document with unique identifier {}", uid);
 
-	KorapResponse kresp = new KorapResponse();
-	kresp.setNode(KorapNode.getName());
+        // Get index
+        KorapIndex index = KorapNode.getIndex();
 
-	if (index == null) {
-	    kresp.addError(601, "Unable to find index");
-	    return kresp.toJsonString();
-	};
+        KorapResponse kresp = new KorapResponse();
+        kresp.setNode(KorapNode.getName());
 
-	kresp.setVersion(index.getVersion());
-	kresp.setName(index.getName());
+        if (index == null) {
+            kresp.addError(601, "Unable to find index");
+            return kresp.toJsonString();
+        };
 
-	String ID = "Unknown";
-	try {
-	    FieldDocument fd = index.addDoc(uid, json);
-	    ID = fd.getID();
-	}
-	// Set HTTP to ???
-	// TODO: This may be a field error!
-	catch (IOException e) {
-	    kresp.addError(602, "Unable to add document to index");
-	    return kresp.toJsonString();
-	};
+        kresp.setVersion(index.getVersion());
+        kresp.setName(index.getName());
 
-	// Set HTTP to 200
-	kresp.addMessage(681, "Document was added successfully", ID);
-	return kresp.toJsonString();
+        String ID = "Unknown";
+        try {
+            FieldDocument fd = index.addDoc(uid, json);
+            ID = fd.getID();
+        }
+        // Set HTTP to ???
+        // TODO: This may be a field error!
+        catch (IOException e) {
+            kresp.addError(602, "Unable to add document to index");
+            return kresp.toJsonString();
+        };
+
+        // Set HTTP to 200
+        kresp.addMessage(681, "Document was added successfully", ID);
+
+
+        System.err.println(kresp.toJsonString());
+        return kresp.toJsonString();
     };
 
 
@@ -170,31 +179,31 @@
     @Produces(MediaType.APPLICATION_JSON)
     public String commit () {
 
-	// Get index
-	KorapIndex index = KorapNode.getIndex();
-	KorapResponse kresp = new KorapResponse();
-	kresp.setNode(KorapNode.getName());
+        // Get index
+        KorapIndex index = KorapNode.getIndex();
+        KorapResponse kresp = new KorapResponse();
+        kresp.setNode(KorapNode.getName());
 
-	if (index == null) {
-	    kresp.addError(601, "Unable to find index");
-	    return kresp.toJsonString();
-	};
+        if (index == null) {
+            kresp.addError(601, "Unable to find index");
+            return kresp.toJsonString();
+        };
 
-	kresp.setVersion(index.getVersion());
-	kresp.setName(index.getName());
+        kresp.setVersion(index.getVersion());
+        kresp.setName(index.getName());
+        
+        // There are documents to commit
+        try {
+            index.commit();
+        }
+        catch (IOException e) {
+            // Set HTTP to ???
+            kresp.addError(603, "Unable to commit staged data to index");
+            return kresp.toJsonString();
+        };
 
-	// There are documents to commit
-	try {
-	    index.commit();
-	}
-	catch (IOException e) {
-	    // Set HTTP to ???
-	    kresp.addError(603, "Unable to commit staged data to index");
-	    return kresp.toJsonString();
-	};
-
-	// Set HTTP to ???
-	return kresp.toJsonString();
+        // Set HTTP to ???
+        return kresp.toJsonString();
     };
 
 
@@ -209,47 +218,47 @@
     @Consumes(MediaType.APPLICATION_JSON)
     public String find (String json, @Context UriInfo uri) {
 
-	// Get index
-	KorapIndex index = KorapNode.getIndex();
+        // Get index
+        KorapIndex index = KorapNode.getIndex();
 
-	// Search index
+        // Search index
         if (index != null) {
-	    KorapSearch ks = new KorapSearch(json);
+            Krill ks = new Krill(json);
 
-	    // Get query parameters
-	    MultivaluedMap<String,String> qp = uri.getQueryParameters();
+            // Get query parameters
+            MultivaluedMap<String,String> qp = uri.getQueryParameters();
 
-	    if (qp.get("uid") != null) {
+            if (qp.get("uid") != null) {
 
-		// Build Collection based on a list of uids
-		List<String> uids = qp.get("uid");
-		KorapCollection kc = new KorapCollection();
-		kc.filterUIDs(uids.toArray(new String[uids.size()]));
+                // Build Collection based on a list of uids
+                List<String> uids = qp.get("uid");
+                KorapCollection kc = new KorapCollection();
+                kc.filterUIDs(uids.toArray(new String[uids.size()]));
+                
+                // TODO: RESTRICT COLLECTION TO ONLY RESPECT SELF DOCS (REPLICATION)
+                
+                // Override old collection
+                ks.setCollection(kc);
 
-		// TODO: RESTRICT COLLECTION TO ONLY RESPECT SELF DOCS (REPLICATION)
+                // Only return the first match per text
+                ks.setItemsPerResource(1);
 
-		// Override old collection
-		ks.setCollection(kc);
+                return ks.apply(index).toJsonString();
+            };
+            KorapResult kr = new KorapResult();
+            kr.setNode(KorapNode.getName());
+            kr.addError(610, "Missing request parameters", "No unique IDs were given");
+            return kr.toJsonString();
+        };
 
-		// Only return the first match per text
-		ks.setItemsPerResource(1);
-
-		return ks.apply(index).toJsonString();
-	    };
-	    KorapResult kr = new KorapResult();
-	    kr.setNode(KorapNode.getName());
-	    kr.addError(610, "Missing request parameters", "No unique IDs were given");
-	    return kr.toJsonString();
-	};
-
-	KorapResponse kresp = new KorapResponse();
-	kresp.setNode(KorapNode.getName());
-	kresp.setName(index.getName());
-	kresp.setVersion(index.getVersion());
-
-	kresp.addError(601, "Unable to find index");
-	
-	return kresp.toJsonString();
+        KorapResponse kresp = new KorapResponse();
+        kresp.setNode(KorapNode.getName());
+        kresp.setName(index.getName());
+        kresp.setVersion(index.getVersion());
+        
+        kresp.addError(601, "Unable to find index");
+        
+        return kresp.toJsonString();
     };
 
 
@@ -263,45 +272,45 @@
     @Produces(MediaType.APPLICATION_JSON)
     @Consumes(MediaType.APPLICATION_JSON)
     public String collect (String json,
-			   @PathParam("resultID") String resultID,
-			   @Context UriInfo uri) {
+                           @PathParam("resultID") String resultID,
+                           @Context UriInfo uri) {
 
-	// Get index
-	KorapIndex index = KorapNode.getIndex();
+        // Get index
+        KorapIndex index = KorapNode.getIndex();
 
-	// No index found
-	if (index == null) {
-	    KorapResponse kresp = new KorapResponse();
-	    kresp.setNode(KorapNode.getName());
-	    kresp.addError(601, "Unable to find index");
-  	    return kresp.toJsonString();
-	};
+        // No index found
+        if (index == null) {
+            KorapResponse kresp = new KorapResponse();
+            kresp.setNode(KorapNode.getName());
+            kresp.addError(601, "Unable to find index");
+            return kresp.toJsonString();
+        };
 
-	// Get the database
-	try {
-	    MatchCollectorDB mc = new MatchCollectorDB(1000, "Res_" + resultID);
-	    Connection conn = KorapNode.getDBPool().getConnection();
-	    mc.setDBPool("mysql", KorapNode.getDBPool(), conn);
+        // Get the database
+        try {
+            MatchCollectorDB mc = new MatchCollectorDB(1000, "Res_" + resultID);
+            Connection conn = KorapNode.getDBPool().getConnection();
+            mc.setDBPool("mysql", KorapNode.getDBPool(), conn);
+            
+            // TODO: Only search in self documents (REPLICATION FTW!)
+            
+            Krill ks = new Krill(json);
+            MatchCollector result = index.collect(ks, mc);
 
-	    // TODO: Only search in self documents (REPLICATION FTW!)
+            result.setNode(KorapNode.getName());
+            return result.toJsonString();
+        }
+        catch (SQLException e) {
+            log.error(e.getLocalizedMessage());
+        };
 
-	    KorapSearch ks = new KorapSearch(json);
-	    MatchCollector result = index.collect(ks, mc);
+        KorapResponse kresp = new KorapResponse();
+        kresp.setNode(KorapNode.getName());
+        kresp.setName(index.getName());
+        kresp.setVersion(index.getVersion());
 
-	    result.setNode(KorapNode.getName());
-	    return result.toJsonString();
-	}
-	catch (SQLException e) {
-	    log.error(e.getLocalizedMessage());
-	};
-
-	KorapResponse kresp = new KorapResponse();
-	kresp.setNode(KorapNode.getName());
-	kresp.setName(index.getName());
-	kresp.setVersion(index.getVersion());
-
-	kresp.addError(604, "Unable to connect to database");
-	return kresp.toJsonString();
+        kresp.addError(604, "Unable to connect to database");
+        return kresp.toJsonString();
     };
 
 
@@ -329,7 +338,7 @@
 
 	// Search index
         if (index != null) {
-            KorapResult kr = new KorapSearch(json).apply(index);
+            KorapResult kr = new Krill(json).apply(index);
 	    kr.setNode(KorapNode.getName());
 	    return kr.toJsonString();
 	};
diff --git a/src/main/java/de/ids_mannheim/korap/response/KorapResponse.java b/src/main/java/de/ids_mannheim/korap/response/KorapResponse.java
index 3f7e54e..b082f29 100644
--- a/src/main/java/de/ids_mannheim/korap/response/KorapResponse.java
+++ b/src/main/java/de/ids_mannheim/korap/response/KorapResponse.java
@@ -9,6 +9,7 @@
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.fasterxml.jackson.databind.node.ObjectNode;
 
+import de.ids_mannheim.korap.KorapQuery;
 import de.ids_mannheim.korap.response.Notifications;
 
 /**
@@ -31,6 +32,8 @@
     ObjectMapper mapper = new ObjectMapper();
 
     private String version, name, node, listener;
+    private KorapQuery query;
+
     private long
         totalResources = -2, // Not set
         totalResults   = -2; // Not set
@@ -313,6 +316,31 @@
 
 
     /**
+     * Get the KoralQuery query object.
+     *
+     * @return The {@link KorapQuery} object,
+     *         representing the KoralQuery query object.
+     */
+    @JsonIgnore
+    public KorapQuery getQuery () {
+        return this.query;
+    };
+
+
+    /**
+     * Set the KoralQuery query object.
+     *
+     * @param query The {@link KorapQuery} object,
+     *        representing the KoralQuery query object.
+     */
+    @JsonIgnore
+    public KorapResponse setQuery (KorapQuery query) {
+        this.query = query;
+        return this;
+    };
+
+
+    /**
      * Serialize response as a {@link JsonNode}.
      *
      * @return {@link JsonNode} representation of the response
@@ -358,6 +386,14 @@
         if (this.totalResults != -2)
             json.put("totalResults", this.totalResults);
 
+        // KoralQuery query object
+        if (this.getQuery() != null) {
+            JsonNode queryNode =
+                this.getQuery().toJsonNode();
+            if (queryNode != null)
+                json.put("query", queryNode);
+        };
+
         return (JsonNode) json;
     };
 
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 ce3e202..2501b31 100644
--- a/src/test/java/de/ids_mannheim/korap/benchmark/TestBenchmarkSpans.java
+++ b/src/test/java/de/ids_mannheim/korap/benchmark/TestBenchmarkSpans.java
@@ -6,7 +6,7 @@
 import de.ids_mannheim.korap.KorapIndex;
 import de.ids_mannheim.korap.index.FieldDocument;
 import de.ids_mannheim.korap.KorapCollection;
-import de.ids_mannheim.korap.KorapSearch;
+import de.ids_mannheim.korap.Krill;
 import de.ids_mannheim.korap.KorapResult;
 import de.ids_mannheim.korap.KorapQuery;
 import org.apache.lucene.store.MMapDirectory;
@@ -46,7 +46,7 @@
 
         t1 = System.nanoTime();
         for (int i = 1; i <= rounds; i++) {
-            kr = new KorapSearch(json).apply(ki);
+            kr = new Krill(json).apply(ki);
         };
         t2 = System.nanoTime();
 
@@ -99,7 +99,7 @@
         t1 = System.nanoTime();
         double length = 0;
         for (int i = 1; i <= rounds; i++) {
-            kr = new KorapSearch(json).apply(ki);
+            kr = new Krill(json).apply(ki);
             length += kr.toJsonString().length();
         };
         t2 = System.nanoTime();
@@ -141,7 +141,7 @@
         t1 = System.nanoTime();
         double length = 0;
         for (int i = 1; i <= rounds; i++) {
-            kr = new KorapSearch(json).apply(ki);
+            kr = new Krill(json).apply(ki);
         };
         t2 = System.nanoTime();
 
@@ -182,7 +182,7 @@
 
         t1 = System.nanoTime();
         for (int i = 1; i <= rounds; i++) {
-            kr = new KorapSearch(json).apply(ki);
+            kr = new Krill(json).apply(ki);
         };
         t2 = System.nanoTime();
 
@@ -197,7 +197,7 @@
         
         t1 = System.nanoTime();
         for (int i = 1; i <= rounds; i++) {
-            kr = new KorapSearch(json).apply(ki);
+            kr = new Krill(json).apply(ki);
         };
         t2 = System.nanoTime();
 
@@ -212,7 +212,7 @@
 
         t1 = System.nanoTime();
         for (int i = 1; i <= rounds; i++) {
-            kr = new KorapSearch(json).apply(ki);
+            kr = new Krill(json).apply(ki);
         };
         t2 = System.nanoTime();
 
@@ -329,7 +329,7 @@
 
         t1 = System.nanoTime();
         for (int i = 1; i <= rounds; i++) {
-            kr = new KorapSearch(json).apply(ki);
+            kr = new Krill(json).apply(ki);
         };
         t2 = System.nanoTime();
 
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 b3b5736..07650dd 100644
--- a/src/test/java/de/ids_mannheim/korap/highlight/TestClass.java
+++ b/src/test/java/de/ids_mannheim/korap/highlight/TestClass.java
@@ -14,7 +14,7 @@
 import de.ids_mannheim.korap.KorapMatch;
 import de.ids_mannheim.korap.KorapQuery;
 import de.ids_mannheim.korap.KorapResult;
-import de.ids_mannheim.korap.KorapSearch;
+import de.ids_mannheim.korap.Krill;
 import de.ids_mannheim.korap.query.SpanNextQuery;
 import de.ids_mannheim.korap.query.wrap.SpanQueryWrapper;
 import de.ids_mannheim.korap.util.QueryException;
@@ -23,7 +23,7 @@
 public class TestClass {
 	KorapIndex ki;
 	KorapResult kr;
-	KorapSearch ks;
+	Krill ks;
 	
 	@Test
 	public void queryJSONpoly1() throws QueryException, IOException {
diff --git a/src/test/java/de/ids_mannheim/korap/highlight/TestHighlight.java b/src/test/java/de/ids_mannheim/korap/highlight/TestHighlight.java
index 0118e1b..1fd999f 100644
--- a/src/test/java/de/ids_mannheim/korap/highlight/TestHighlight.java
+++ b/src/test/java/de/ids_mannheim/korap/highlight/TestHighlight.java
@@ -8,7 +8,7 @@
 import de.ids_mannheim.korap.KorapIndex;
 import de.ids_mannheim.korap.KorapQuery;
 import de.ids_mannheim.korap.KorapResult;
-import de.ids_mannheim.korap.KorapSearch;
+import de.ids_mannheim.korap.Krill;
 import de.ids_mannheim.korap.KorapMatch;
 import de.ids_mannheim.korap.index.FieldDocument;
 
@@ -211,7 +211,7 @@
 
         kq = new KorapQuery("base");
         q = (SpanQuery) kq.or(kq._(1, kq.seg("i:a"))).or(kq._(2, kq.seg("i:c"))).toQuery();
-        KorapSearch qs = new KorapSearch(q);
+        Krill qs = new Krill(q);
         qs.getContext().left.setToken(true).setLength((short) 1);
         qs.getContext().right.setToken(true).setLength((short) 1);
         kr = ki.search(qs);
@@ -247,7 +247,7 @@
         q = (SpanQuery) kq._(
             3, kq.or(kq._(1, kq.seg("i:a"))).or(kq._(2, kq.seg("i:c")))
         ).toQuery();
-        qs = new KorapSearch(q);
+        qs = new Krill(q);
         qs.getContext().left.setToken(true).setLength((short) 0);
         qs.getContext().right.setToken(true).setLength((short) 0);
         kr = ki.search(qs);
@@ -281,7 +281,7 @@
         // 15
         String json = getString(getClass().getResource("/queries/bugs/greater_highlights_15.jsonld").getFile());
 	
-        KorapSearch ks = new KorapSearch(json);
+        Krill ks = new Krill(json);
         KorapResult kr = ks.apply(ki);
         assertEquals(kr.getSerialQuery(),"{15: tokens:s:Alphabet}");
         assertEquals(kr.getTotalResults(),7);
@@ -292,7 +292,7 @@
         json = getString(getClass().getResource("/queries/bugs/greater_highlights_16.jsonld").getFile());
 
         // 16
-        ks = new KorapSearch(json);
+        ks = new Krill(json);
         kr = ks.apply(ki);
         assertEquals(kr.getSerialQuery(),"{16: tokens:s:Alphabet}");
         assertEquals(kr.getTotalResults(),7);
@@ -303,7 +303,7 @@
         // 127
         json = getString(getClass().getResource("/queries/bugs/greater_highlights_127.jsonld").getFile());
 	
-        ks = new KorapSearch(json);
+        ks = new Krill(json);
         kr = ks.apply(ki);
         assertEquals(kr.getSerialQuery(),"{127: tokens:s:Alphabet}");
         assertEquals(kr.getTotalResults(),7);
@@ -314,7 +314,7 @@
         // 255
         json = getString(getClass().getResource("/queries/bugs/greater_highlights_255.jsonld").getFile());
 
-        ks = new KorapSearch(json);
+        ks = new Krill(json);
         kr = ks.apply(ki);
         assertEquals(kr.getSerialQuery(),"{255: tokens:s:Alphabet}");
         assertEquals(kr.getTotalResults(),7);
@@ -325,7 +325,7 @@
         // 300
         json = getString(getClass().getResource("/queries/bugs/greater_highlights_300.jsonld").getFile());
 
-        ks = new KorapSearch(json);
+        ks = new Krill(json);
         kr = ks.apply(ki);
         assertEquals(709, kr.getError(0).getCode());
         assertEquals("Valid class numbers exceeded", kr.getError(0).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 04ea612..7eebc61 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestFieldDocument.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestFieldDocument.java
@@ -19,7 +19,7 @@
 import de.ids_mannheim.korap.KorapIndex;
 import de.ids_mannheim.korap.KorapQuery;
 import de.ids_mannheim.korap.KorapResult;
-import de.ids_mannheim.korap.KorapSearch;
+import de.ids_mannheim.korap.Krill;
 import de.ids_mannheim.korap.KorapMatch;
 import de.ids_mannheim.korap.KorapDocument;
 import de.ids_mannheim.korap.query.SpanNextQuery;
@@ -175,13 +175,13 @@
 
 	KorapQuery kq = new KorapQuery("tokens");
 
-	KorapSearch ks;
+	Krill ks;
 	KorapResult kr;
 
 	// Start creating query
 	// within(<s>, {1: {2: [mate/p=ADJA & mate/m=number:sg]}[opennlp/p=NN & tt/p=NN]})
 
-	ks = new KorapSearch(kq.within(
+	ks = new Krill(kq.within(
               kq.tag("s"),
               kq._(1,
                 kq.seq(
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestMatchCollector.java b/src/test/java/de/ids_mannheim/korap/index/TestMatchCollector.java
index 854f6f6..62781d2 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestMatchCollector.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestMatchCollector.java
@@ -18,7 +18,7 @@
 import de.ids_mannheim.korap.KorapMatch;
 import de.ids_mannheim.korap.index.MatchCollector;
 import de.ids_mannheim.korap.KorapCollection;
-import de.ids_mannheim.korap.KorapSearch;
+import de.ids_mannheim.korap.Krill;
 import de.ids_mannheim.korap.query.SpanNextQuery;
 import de.ids_mannheim.korap.query.SpanClassQuery;
 import de.ids_mannheim.korap.index.FieldDocument;
@@ -77,7 +77,7 @@
 
 	sq = new SpanTermQuery(new Term("base", "s:b"));
 	MatchCollector mc = ki.collect(
-	  new KorapSearch(sq).setCount((short) 10),
+	  new Krill(sq).setCount((short) 10),
 	  new MatchCollector()
 	);
 
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestMatchIdentifier.java b/src/test/java/de/ids_mannheim/korap/index/TestMatchIdentifier.java
index 5d320e4..a98ed05 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestMatchIdentifier.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestMatchIdentifier.java
@@ -14,7 +14,7 @@
 
 import de.ids_mannheim.korap.KorapIndex;
 import de.ids_mannheim.korap.KorapQuery;
-import de.ids_mannheim.korap.KorapSearch;
+import de.ids_mannheim.korap.Krill;
 import de.ids_mannheim.korap.KorapResult;
 import de.ids_mannheim.korap.KorapMatch;
 import de.ids_mannheim.korap.util.QueryException;
@@ -92,7 +92,7 @@
 	ki.commit();
 
 	KorapQuery kq = new KorapQuery("tokens");
-	KorapSearch ks = new KorapSearch(
+	Krill ks = new Krill(
 	    kq._(2,kq.seq(kq.seg("s:b")).append(kq._(kq.seg("s:a"))))
         );
 	KorapResult kr = ki.search(ks);
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestRealIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestRealIndex.java
index 7d0fc46..8b86c7f 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestRealIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestRealIndex.java
@@ -19,7 +19,7 @@
 public class TestRealIndex {
     KorapIndex ki;
     KorapResult kr;
-    KorapSearch ks;
+    Krill ks;
     KorapQuery kq;
 	
     public TestRealIndex() throws IOException {
@@ -36,7 +36,7 @@
     @Test
     public void testCase1() throws IOException, QueryException {
 	KorapQuery kq = new KorapQuery("tokens");
-	ks = new KorapSearch(kq.within(kq.tag("base/s:s"), kq.seq(kq.re("s:.*")).append(kq._(kq.re("s:.*")))).toQuery());
+	ks = new Krill(kq.within(kq.tag("base/s:s"), kq.seq(kq.re("s:.*")).append(kq._(kq.re("s:.*")))).toQuery());
 	ks.setTimeOut(10000);
 	kr = ks.apply(ki);
 	System.err.println(kr.toJsonString());
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestRegexWildcardIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestRegexWildcardIndex.java
index 20273bc..6815a49 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestRegexWildcardIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestRegexWildcardIndex.java
@@ -16,7 +16,7 @@
 import de.ids_mannheim.korap.KorapIndex;
 import de.ids_mannheim.korap.KorapQuery;
 import de.ids_mannheim.korap.KorapResult;
-import de.ids_mannheim.korap.KorapSearch;
+import de.ids_mannheim.korap.Krill;
 import de.ids_mannheim.korap.index.FieldDocument;
 import de.ids_mannheim.korap.model.MultiTermTokenStream;
 import org.apache.lucene.search.Query;
@@ -52,7 +52,7 @@
 	SpanQuery sq = kq.re("s:af*e").toQuery();
 	assertEquals("SpanMultiTermQueryWrapper(base:/s:af*e/)", sq.toString());
 			
-	KorapSearch ks = new KorapSearch(sq);
+	Krill ks = new Krill(sq);
 	ks.context.left.setToken(true).setLength(1);
 	ks.context.right.setToken(true).setLength(1);
 
@@ -109,7 +109,7 @@
 	SpanQuery sq = kq.wc("s:af*e").toQuery();
 	assertEquals("SpanMultiTermQueryWrapper(base:s:af*e)", sq.toString());
 
-	KorapSearch ks = new KorapSearch(sq);
+	Krill ks = new Krill(sq);
 	ks.context.left.setToken(true).setLength(1);
 	ks.context.right.setToken(true).setLength(1);
 
@@ -168,7 +168,7 @@
 	SpanQuery sq = kq.re("s:Af*e", true).toQuery();
 	assertEquals("SpanMultiTermQueryWrapper(base:/i:af*e/)", sq.toString());
 
-	KorapSearch ks = new KorapSearch(sq);
+	Krill ks = new Krill(sq);
 	ks.context.left.setToken(true).setLength(1);
 	ks.context.right.setToken(true).setLength(1);
 
@@ -233,7 +233,7 @@
 	SpanQuery sq = kq.seq(kq.seg("s:affe")).append(kq.re("s:af*e")).toQuery();
 	assertEquals("spanNext(base:s:affe, SpanMultiTermQueryWrapper(base:/s:af*e/))", sq.toString());
 
-	KorapSearch ks = new KorapSearch(sq);
+	Krill ks = new Krill(sq);
 	ks.context.left.setToken(true).setLength(1);
 	ks.context.right.setToken(true).setLength(1);
 
@@ -274,7 +274,7 @@
 						   ),
 				   kq.seg("s:affe")).toQuery();
 	assertEquals("spanContain(spanNext(SpanMultiTermQueryWrapper(base:/s:a.*e/), SpanMultiTermQueryWrapper(base:/s:af*e/)), base:s:affe)", sq.toString());
-	KorapSearch ks = new KorapSearch(sq);
+	Krill ks = new Krill(sq);
 	ks.context.left.setToken(true).setLength(1);
 	ks.context.right.setToken(true).setLength(1);
 
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestWPDIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestWPDIndex.java
index 6711653..25516e6 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestWPDIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestWPDIndex.java
@@ -17,7 +17,7 @@
 import de.ids_mannheim.korap.KorapIndex;
 import de.ids_mannheim.korap.KorapMatch;
 import de.ids_mannheim.korap.KorapResult;
-import de.ids_mannheim.korap.KorapSearch;
+import de.ids_mannheim.korap.Krill;
 import de.ids_mannheim.korap.collection.BooleanFilter;
 import de.ids_mannheim.korap.query.DistanceConstraint;
 import de.ids_mannheim.korap.query.SpanDistanceQuery;
@@ -29,7 +29,7 @@
 	long start, end;
 	KorapIndex ki;
 	KorapResult kr;
-	KorapSearch ks;
+	Krill ks;
 	
 	private SpanDistanceQuery createElementDistanceQuery(String e, String x, String y, 
 			int min, int max, boolean isOrdered, boolean exclusion){
@@ -70,18 +70,18 @@
 		SpanDistanceQuery sq;
 		// ordered
 		sq = createDistanceQuery("s:Wir", "s:kommen", 1, 1, true,false);
-		ks = new KorapSearch(sq);
+		ks = new Krill(sq);
 		kr = ks.apply(ki);
 		assertEquals(kr.getTotalResults(), 8);
 
 		// unordered
 		sq = createDistanceQuery("s:Wir", "s:kommen", 1, 1, false,false);				
-		ks = new KorapSearch(sq);
+		ks = new Krill(sq);
 		kr = ks.apply(ki);
 		assertEquals(kr.getTotalResults(), 11);
 		
 		sq = createDistanceQuery("s:kommen", "s:Wir", 1, 1, false,false);				
-		ks = new KorapSearch(sq);
+		ks = new Krill(sq);
 		kr = ks.apply(ki);
 		assertEquals(kr.getTotalResults(), 11);
 		//System.out.println(kr.getTotalResults());
@@ -97,20 +97,20 @@
 	public void testCase2() throws IOException{
 
 		SpanQuery q = new SpanTermQuery(new Term("tokens","s:Wir"));
-		ks = new KorapSearch(q);
+		ks = new Krill(q);
 		kr = ks.apply(ki);
 		assertEquals(kr.getTotalResults(), 1907);
 		
 		SpanDistanceQuery sq;
 		// ordered
 		sq = createDistanceQuery("s:Wir", "s:kommen", 1, 1, true, true);				
-		ks = new KorapSearch(sq);
+		ks = new Krill(sq);
 		kr = ks.apply(ki);
 		assertEquals(kr.getTotalResults(), 1899);
 		
 		// unordered
 		sq = createDistanceQuery("s:Wir", "s:kommen", 1, 1, false, true);				
-		ks = new KorapSearch(sq);
+		ks = new Krill(sq);
 		kr = ks.apply(ki);
 		assertEquals(kr.getTotalResults(), 1896);	
 	}
@@ -121,13 +121,13 @@
 		// ordered
 		SpanDistanceQuery sq = createElementDistanceQuery("s","s:weg", "s:fahren", 
 				0, 1, true, false);
-		ks = new KorapSearch(sq);
+		ks = new Krill(sq);
 		kr = ks.apply(ki);		
 		assertEquals(kr.getTotalResults(), 3);
 		
 		// unordered
 		sq = createElementDistanceQuery("s","s:weg", "s:fahren", 0, 1, false,false);
-		ks = new KorapSearch(sq);
+		ks = new Krill(sq);
 		kr = ks.apply(ki);
 		assertEquals(kr.getTotalResults(), 5);
 		
@@ -144,7 +144,7 @@
 		
 		// only 1
 		sq = createElementDistanceQuery("s","s:weg", "s:fahren", 1, 1, false,false);
-		ks = new KorapSearch(sq);
+		ks = new Krill(sq);
 		kr = ks.apply(ki);
 		assertEquals(kr.getTotalResults(), 3);		
 	}
@@ -153,7 +153,7 @@
 	@Test
 	public void testCase4() throws IOException{
 		SpanDistanceQuery sq = createElementDistanceQuery("s","s:weg", "s:fahren", 1, 1, false, true);
-		ks = new KorapSearch(sq);
+		ks = new Krill(sq);
 		kr = ks.apply(ki);
 		assertEquals(kr.getTotalResults(), 979);
 		//0.8s
@@ -174,18 +174,18 @@
 	public void testCase5() throws IOException{
 		SpanQuery sq;
 		sq = new SpanRepetitionQuery(new SpanTermQuery(new Term("tokens","mate/p:ADJA")),1,2, true);
-		ks = new KorapSearch(sq);
+		ks = new Krill(sq);
 		kr = ks.apply(ki);
 		assertEquals(kr.getTotalResults(), 4116416);
 		//0.9s
 		
 		sq = new SpanRepetitionQuery(new SpanTermQuery(new Term("tokens","mate/p:ADJA")),1,1, true);
-		ks = new KorapSearch(sq);
+		ks = new Krill(sq);
 		kr = ks.apply(ki);
 		assertEquals(kr.getTotalResults(), 3879671);
 		
 		sq = new SpanRepetitionQuery(new SpanTermQuery(new Term("tokens","mate/p:ADJA")),2,2, true);
-		ks = new KorapSearch(sq);
+		ks = new Krill(sq);
 		kr = ks.apply(ki);
 		assertEquals(kr.getTotalResults(), 236745);
 		//0.65s
@@ -198,14 +198,14 @@
         		new SpanTermQuery(new Term("tokens", "tt/p:NN")),
         		new SpanRepetitionQuery(new SpanTermQuery(new Term("tokens","mate/p:ADJA")),2,2, true)
     		);
-		ks = new KorapSearch(sq);
+		ks = new Krill(sq);
 		kr = ks.apply(ki);
 		assertEquals(kr.getTotalResults(), 30223);
 		// 1.1s
 		
 		SpanQuery sq2 = new SpanNextQuery(sq,
 				new SpanTermQuery(new Term("tokens", "tt/p:NN")));
-		ks = new KorapSearch(sq2);
+		ks = new Krill(sq2);
 		kr = ks.apply(ki);
 		assertEquals(kr.getTotalResults(), 26607);
 		// 1.1s
diff --git a/src/test/java/de/ids_mannheim/korap/node/TestResource.java b/src/test/java/de/ids_mannheim/korap/node/TestResource.java
index 643ec6a..5c80b59 100644
--- a/src/test/java/de/ids_mannheim/korap/node/TestResource.java
+++ b/src/test/java/de/ids_mannheim/korap/node/TestResource.java
@@ -10,6 +10,7 @@
 import javax.ws.rs.client.Entity;
 
 import org.glassfish.grizzly.http.server.HttpServer;
+import com.fasterxml.jackson.jaxrs.annotation.JacksonFeatures;
 
 import static org.junit.Assert.*;
 import org.junit.After;
@@ -29,7 +30,6 @@
  */
 // http://harryjoy.com/2012/09/08/simple-rest-client-in-java/
 public class TestResource {
-
     private HttpServer server;
     private WebTarget target;
 
@@ -44,8 +44,17 @@
         // support for JSON in the client (you also have to uncomment
         // dependency on jersey-media-json module in pom.xml and Main.startServer())
         // --
-        // c.configuration().enable(new org.glassfish.jersey.media.json.JsonJaxbFeature());
 
+        // c.configuration().enable(com.sun.jersey.api.json.POJOMappingFeature());
+        // c.configuration().enable(new org.glassfish.jersey.media.json.JsonJaxbFeature());
+        // c.register(JacksonFeature.class);
+        // c.register(com.fasterxml.jackson.jaxrs.annotation.JacksonFeatures.class);
+
+        /*
+        ClientConfig clientConfig = new DefaultClientConfig();
+        clientConfig.getFeatures().put(JSONConfiguration.FEATURE_POJO_MAPPING, Boolean.TRUE);
+        Client c = Client.create(clientConfig);
+*/
         target = c.target(KorapNode.BASE_URI);
     };
 
@@ -80,9 +89,11 @@
                 getClass().getResource("/wiki/" + i + ".json").getFile()
             );
 
+            Entity jsonE = Entity.json(json);
+
             kresp = target.path("/index/" + i).
                 request("application/json").
-                put(Entity.json(json), KorapResponse.class);
+                put(jsonE, KorapResponse.class);
 
             assertEquals(kresp.getNode(), "milena");
             assertFalse(kresp.hasErrors());
diff --git a/src/test/java/de/ids_mannheim/korap/query/TestTemporaryQueryLimitations.java b/src/test/java/de/ids_mannheim/korap/query/TestTemporaryQueryLimitations.java
index 73ada81..de572cc 100644
--- a/src/test/java/de/ids_mannheim/korap/query/TestTemporaryQueryLimitations.java
+++ b/src/test/java/de/ids_mannheim/korap/query/TestTemporaryQueryLimitations.java
@@ -8,7 +8,7 @@
 import de.ids_mannheim.korap.KorapIndex;
 import de.ids_mannheim.korap.KorapQuery;
 import de.ids_mannheim.korap.KorapResult;
-import de.ids_mannheim.korap.KorapSearch;
+import de.ids_mannheim.korap.Krill;
 import de.ids_mannheim.korap.KorapMatch;
 import de.ids_mannheim.korap.index.FieldDocument;
 
@@ -52,7 +52,7 @@
 
 	json = getString(getClass().getResource("/queries/bugs/cosmas_classrefcheck.jsonld").getFile());
 	
-	KorapSearch ks = new KorapSearch(json);
+	Krill ks = new Krill(json);
 	KorapResult kr = ks.apply(ki);
 	assertEquals(kr.getSerialQuery(),"focus(130: {131: spanContain({129: <tokens:s />}, {130: tokens:s:wegen})})");
 	assertEquals(kr.getTotalResults(),0);
diff --git a/src/test/java/de/ids_mannheim/korap/search/TestKorapResult.java b/src/test/java/de/ids_mannheim/korap/search/TestKorapResult.java
index 80776b5..cfbedff 100644
--- a/src/test/java/de/ids_mannheim/korap/search/TestKorapResult.java
+++ b/src/test/java/de/ids_mannheim/korap/search/TestKorapResult.java
@@ -8,7 +8,7 @@
 import de.ids_mannheim.korap.KorapIndex;
 import de.ids_mannheim.korap.KorapQuery;
 import de.ids_mannheim.korap.KorapResult;
-import de.ids_mannheim.korap.KorapSearch;
+import de.ids_mannheim.korap.Krill;
 import de.ids_mannheim.korap.KorapMatch;
 import de.ids_mannheim.korap.index.FieldDocument;
 
@@ -30,239 +30,240 @@
 
     @Test
     public void checkJSONResult () throws Exception  {
-	KorapIndex ki = new KorapIndex();
-	FieldDocument fd = new FieldDocument();
-	fd.addString("ID", "doc-1");
-	fd.addString("UID", "1");
-	fd.addTV("base",
-		 "abab",
-		 "[(0-1)s:a|i:a|_0#0-1|-:t$<i>4]" +
-		 "[(1-2)s:b|i:b|_1#1-2]" +
-		 "[(2-3)s:a|i:c|_2#2-3]" +
-		 "[(3-4)s:b|i:a|_3#3-4]");
-	ki.addDoc(fd);
-	fd = new FieldDocument();
-	fd.addString("ID", "doc-2");
-	fd.addString("UID", "2");
-	fd.addTV("base",
-		 "aba",
-		 "[(0-1)s:a|i:a|_0#0-1|-:t$<i>3]" +
-		 "[(1-2)s:b|i:b|_1#1-2]" +
-		 "[(2-3)s:a|i:c|_2#2-3]");
-	ki.addDoc(fd);
+        KorapIndex ki = new KorapIndex();
+        FieldDocument fd = new FieldDocument();
+        fd.addString("ID", "doc-1");
+        fd.addString("UID", "1");
+        fd.addTV("base",
+                 "abab",
+                 "[(0-1)s:a|i:a|_0#0-1|-:t$<i>4]" +
+                 "[(1-2)s:b|i:b|_1#1-2]" +
+                 "[(2-3)s:a|i:c|_2#2-3]" +
+                 "[(3-4)s:b|i:a|_3#3-4]");
+        ki.addDoc(fd);
+        fd = new FieldDocument();
+        fd.addString("ID", "doc-2");
+        fd.addString("UID", "2");
+        fd.addTV("base",
+                 "aba",
+                 "[(0-1)s:a|i:a|_0#0-1|-:t$<i>3]" +
+                 "[(1-2)s:b|i:b|_1#1-2]" +
+                 "[(2-3)s:a|i:c|_2#2-3]");
+        ki.addDoc(fd);
 
-	// Commit!
-	ki.commit();
+        // Commit!
+        ki.commit();
 
-	KorapQuery kq = new KorapQuery("base");
-	SpanQuery q = (SpanQuery) kq.or(kq._(1, kq.seg("s:a"))).or(kq._(2, kq.seg("s:b"))).toQuery();
-	KorapResult kr = ki.search(q);
-	assertEquals((long) 7, kr.getTotalResults());
+        KorapQuery kq = new KorapQuery("base");
+        SpanQuery q = (SpanQuery) kq.or(
+            kq._(1, kq.seg("s:a"))).or(kq._(2, kq.seg("s:b"))
+        ).toQuery();
+        KorapResult kr = ki.search(q);
+        assertEquals((long) 7, kr.getTotalResults());
 
-	ObjectMapper mapper = new ObjectMapper();
-	JsonNode res = mapper.readTree(kr.toJsonString());
-	assertEquals(7, res.at("/totalResults").asInt());
-	assertEquals("spanOr([{1: base:s:a}, {2: base:s:b}])", res.at("/serialQuery").asText());
-	assertEquals(0, res.at("/startIndex").asInt());
-	assertEquals(25, res.at("/itemsPerPage").asInt());
-	assertEquals("token", res.at("/context/left/0").asText());
-	assertEquals(6, res.at("/context/left/1").asInt());
-	assertEquals("token", res.at("/context/right/0").asText());
-	assertEquals(6, res.at("/context/right/1").asInt());
+        ObjectMapper mapper = new ObjectMapper();
+        JsonNode res = mapper.readTree(kr.toJsonString());
+        assertEquals(7, res.at("/totalResults").asInt());
+        assertEquals("spanOr([{1: base:s:a}, {2: base:s:b}])",
+                     res.at("/serialQuery").asText());
+        assertEquals(0, res.at("/startIndex").asInt());
+        assertEquals(25, res.at("/itemsPerPage").asInt());
+        assertEquals("token", res.at("/context/left/0").asText());
+        assertEquals(6, res.at("/context/left/1").asInt());
+        assertEquals("token", res.at("/context/right/0").asText());
+        assertEquals(6, res.at("/context/right/1").asInt());
 
-	assertEquals("base", res.at("/matches/0/field").asText());
-	/*
-	  Probably a Jackson bug
-	  assertTrue(res.at("/matches/0/startMore").asBoolean());
-	  assertTrue(res.at("/matches/0/endMore").asBoolean());
-	*/
-	assertEquals(1, res.at("/matches/0/UID").asInt());
-	assertEquals("doc-1", res.at("/matches/0/docID").asText());
-	assertEquals("match-doc-1-p0-1(1)0-0", res.at("/matches/0/ID").asText());
-	assertEquals("<span class=\"context-left\"></span><mark><mark class=\"class-1 level-0\">a</mark></mark><span class=\"context-right\">bab</span>", res.at("/matches/0/snippet").asText());
+        assertEquals("base", res.at("/matches/0/field").asText());
+        /*
+          Probably a Jackson bug
+          assertTrue(res.at("/matches/0/startMore").asBoolean());
+          assertTrue(res.at("/matches/0/endMore").asBoolean());
+        */
+        assertEquals(1, res.at("/matches/0/UID").asInt());
+        assertEquals("doc-1", res.at("/matches/0/docID").asText());
+        assertEquals("match-doc-1-p0-1(1)0-0", res.at("/matches/0/ID").asText());
+        assertEquals("<span class=\"context-left\"></span><mark><mark class=\"class-1 level-0\">a</mark></mark><span class=\"context-right\">bab</span>", res.at("/matches/0/snippet").asText());
 
-	assertEquals("base", res.at("/matches/6/field").asText());
-	/*
-	  Probably a Jackson bug
-	  assertEquals(true, res.at("/matches/6/startMore").asBoolean());
-	  assertEquals(true, res.at("/matches/6/endMore").asBoolean());
-	*/
-	assertEquals(2, res.at("/matches/6/UID").asInt());
-	assertEquals("doc-2", res.at("/matches/6/docID").asText());
-	assertEquals("match-doc-2-p2-3(1)2-2", res.at("/matches/6/ID").asText());
-	assertEquals("<span class=\"context-left\">ab</span><mark><mark class=\"class-1 level-0\">a</mark></mark><span class=\"context-right\"></span>", res.at("/matches/6/snippet").asText());
-
+        assertEquals("base", res.at("/matches/6/field").asText());
+        /*
+          Probably a Jackson bug
+          assertEquals(true, res.at("/matches/6/startMore").asBoolean());
+          assertEquals(true, res.at("/matches/6/endMore").asBoolean());
+        */
+        assertEquals(2, res.at("/matches/6/UID").asInt());
+        assertEquals("doc-2", res.at("/matches/6/docID").asText());
+        assertEquals("match-doc-2-p2-3(1)2-2", res.at("/matches/6/ID").asText());
+        assertEquals("<span class=\"context-left\">ab</span><mark><mark class=\"class-1 level-0\">a</mark></mark><span class=\"context-right\"></span>", res.at("/matches/6/snippet").asText());
     };
 
     @Test
     public void checkJSONResultWarningBug () throws Exception  {
-	KorapIndex ki = new KorapIndex();
-	FieldDocument fd = new FieldDocument();
-	fd.addString("ID", "doc-1");
-	fd.addString("UID", "1");
-	fd.addTV("tokens",
-		 "abab",
-		 "[(0-1)s:a|i:a|_0#0-1|-:t$<i>4]" +
-		 "[(1-2)s:b|i:b|_1#1-2]" +
-		 "[(2-3)s:a|i:c|_2#2-3]" +
-		 "[(3-4)s:b|i:a|_3#3-4]");
-	ki.addDoc(fd);
-	ki.commit();
+        KorapIndex ki = new KorapIndex();
+        FieldDocument fd = new FieldDocument();
+        fd.addString("ID", "doc-1");
+        fd.addString("UID", "1");
+        fd.addTV("tokens",
+                 "abab",
+                 "[(0-1)s:a|i:a|_0#0-1|-:t$<i>4]" +
+                 "[(1-2)s:b|i:b|_1#1-2]" +
+                 "[(2-3)s:a|i:c|_2#2-3]" +
+                 "[(3-4)s:b|i:a|_3#3-4]");
+        ki.addDoc(fd);
+        ki.commit();
 
-	String json = getString(getClass().getResource("/queries/bugs/optionality_warning.jsonld").getFile());
-	KorapSearch ks = new KorapSearch(json);
+        String json = getString(getClass().getResource("/queries/bugs/optionality_warning.jsonld").getFile());
+        Krill ks = new Krill(json);
 
-	KorapResult kr = ks.apply(ki);
-	assertEquals((long) 2, kr.getTotalResults());
+        KorapResult kr = ks.apply(ki);
+        assertEquals((long) 2, kr.getTotalResults());
 
-	ObjectMapper mapper = new ObjectMapper();
-	JsonNode res = mapper.readTree(kr.toJsonString());
+        ObjectMapper mapper = new ObjectMapper();
+        JsonNode res = mapper.readTree(kr.toJsonString());
 
-	// Old:
-	// assertEquals("Optionality of query is ignored", res.at("/warning").asText());
-	assertEquals("Optionality of query is ignored",
-		     res.at("/warnings/0/1").asText());
-
+        // Old:
+        // assertEquals("Optionality of query is ignored", res.at("/warning").asText());
+        assertEquals("Optionality of query is ignored",
+                     res.at("/warnings/0/1").asText());
     };
 
 
     @Test
     public void checkJSONResultForJSONInput () throws Exception  {
-	KorapIndex ki = new KorapIndex();
-	FieldDocument fd = new FieldDocument();
-	fd.addString("ID", "doc-1");
-	fd.addString("UID", "1");
-	fd.addTV("tokens",
-		 "abab",
-		 "[(0-1)s:a|i:a|_0#0-1|-:t$<i>4]" +
-		 "[(1-2)s:b|i:b|_1#1-2]" +
-		 "[(2-3)s:a|i:c|_2#2-3]" +
-		 "[(3-4)s:b|i:a|_3#3-4]");
-	ki.addDoc(fd);
-	fd = new FieldDocument();
-	fd.addString("ID", "doc-2");
-	fd.addString("UID", "2");
-	fd.addTV("tokens",
-		 "aba",
-		 "[(0-1)s:a|i:a|_0#0-1|-:t$<i>3]" +
-		 "[(1-2)s:b|i:b|_1#1-2]" +
-		 "[(2-3)s:a|i:c|_2#2-3]");
-	ki.addDoc(fd);
+        KorapIndex ki = new KorapIndex();
+        FieldDocument fd = new FieldDocument();
+        fd.addString("ID", "doc-1");
+        fd.addString("UID", "1");
+        fd.addTV("tokens",
+                 "abab",
+                 "[(0-1)s:a|i:a|_0#0-1|-:t$<i>4]" +
+                 "[(1-2)s:b|i:b|_1#1-2]" +
+                 "[(2-3)s:a|i:c|_2#2-3]" +
+                 "[(3-4)s:b|i:a|_3#3-4]");
+        ki.addDoc(fd);
+        fd = new FieldDocument();
+        fd.addString("ID", "doc-2");
+        fd.addString("UID", "2");
+        fd.addTV("tokens",
+                 "aba",
+                 "[(0-1)s:a|i:a|_0#0-1|-:t$<i>3]" +
+                 "[(1-2)s:b|i:b|_1#1-2]" +
+                 "[(2-3)s:a|i:c|_2#2-3]");
+        ki.addDoc(fd);
+    
+        // Commit!
+        ki.commit();
 
-	// Commit!
-	ki.commit();
+        String json = getString(
+            getClass().getResource("/queries/bsp-result-check.jsonld").getFile()
+        );
+        Krill ks = new Krill(json);
+        KorapResult kr = ks.apply(ki);
+        assertEquals((long) 7, kr.getTotalResults());
 
-	String json = getString(getClass().getResource("/queries/bsp-result-check.jsonld").getFile());
-	KorapSearch ks = new KorapSearch(json);
-	KorapResult kr = ks.apply(ki);
-	assertEquals((long) 7, kr.getTotalResults());
+        ObjectMapper mapper = new ObjectMapper();
+        JsonNode res = mapper.readTree(kr.toJsonString());
 
-	ObjectMapper mapper = new ObjectMapper();
-	JsonNode res = mapper.readTree(kr.toJsonString());
+        assertEquals(7, res.at("/totalResults").asInt());
+        assertEquals("spanOr([tokens:s:a, tokens:s:b])", res.at("/serialQuery").asText());
+        assertEquals(5, res.at("/itemsPerPage").asInt());
+        assertEquals(0, res.at("/startIndex").asInt());
+        assertEquals(1, res.at("/request/meta/startPage").asInt());
+        assertEquals(5, res.at("/request/meta/count").asInt());
+        assertEquals("token", res.at("/request/meta/context/left/0").asText());
+        assertEquals(3, res.at("/request/meta/context/left/1").asInt());
+        assertEquals("char", res.at("/request/meta/context/right/0").asText());
+        assertEquals(6, res.at("/request/meta/context/right/1").asInt());
 
-	assertEquals(7, res.at("/totalResults").asInt());
-	assertEquals("spanOr([tokens:s:a, tokens:s:b])", res.at("/serialQuery").asText());
-	assertEquals(5, res.at("/itemsPerPage").asInt());
-	assertEquals(0, res.at("/startIndex").asInt());
-	assertEquals(1, res.at("/request/meta/startPage").asInt());
-	assertEquals(5, res.at("/request/meta/count").asInt());
-	assertEquals("token", res.at("/request/meta/context/left/0").asText());
-	assertEquals(3, res.at("/request/meta/context/left/1").asInt());
-	assertEquals("char", res.at("/request/meta/context/right/0").asText());
-	assertEquals(6, res.at("/request/meta/context/right/1").asInt());
+        assertEquals("koral:group", res.at("/request/query/@type").asText());
+        assertEquals("operation:or", res.at("/request/query/operation").asText());
 
-	assertEquals("koral:group", res.at("/request/query/@type").asText());
-	assertEquals("operation:or", res.at("/request/query/operation").asText());
+        assertEquals("koral:token", res.at("/request/query/operands/0/@type").asText());
+        assertEquals("koral:term", res.at("/request/query/operands/0/wrap/@type").asText());
+        assertEquals("orth", res.at("/request/query/operands/0/wrap/layer").asText());
+        assertEquals("a", res.at("/request/query/operands/0/wrap/key").asText());
+        assertEquals("match:eq", res.at("/request/query/operands/0/wrap/match").asText());
 
-	assertEquals("koral:token", res.at("/request/query/operands/0/@type").asText());
-	assertEquals("koral:term", res.at("/request/query/operands/0/wrap/@type").asText());
-	assertEquals("orth", res.at("/request/query/operands/0/wrap/layer").asText());
-	assertEquals("a", res.at("/request/query/operands/0/wrap/key").asText());
-	assertEquals("match:eq", res.at("/request/query/operands/0/wrap/match").asText());
+        assertEquals("koral:token", res.at("/request/query/operands/1/@type").asText());
+        assertEquals("koral:term", res.at("/request/query/operands/1/wrap/@type").asText());
+        assertEquals("orth", res.at("/request/query/operands/1/wrap/layer").asText());
+        assertEquals("b", res.at("/request/query/operands/1/wrap/key").asText());
+        assertEquals("match:eq", res.at("/request/query/operands/1/wrap/match").asText());
 
-	assertEquals("koral:token", res.at("/request/query/operands/1/@type").asText());
-	assertEquals("koral:term", res.at("/request/query/operands/1/wrap/@type").asText());
-	assertEquals("orth", res.at("/request/query/operands/1/wrap/layer").asText());
-	assertEquals("b", res.at("/request/query/operands/1/wrap/key").asText());
-	assertEquals("match:eq", res.at("/request/query/operands/1/wrap/match").asText());
-
-	assertEquals(1, res.at("/matches/0/UID").asInt());
-	assertEquals("doc-1", res.at("/matches/0/docID").asText());
-	assertEquals("match-doc-1-p0-1", res.at("/matches/0/ID").asText());
-	assertEquals("<span class=\"context-left\"></span><mark>a</mark><span class=\"context-right\">bab</span>", res.at("/matches/0/snippet").asText());
-
+        assertEquals(1, res.at("/matches/0/UID").asInt());
+        assertEquals("doc-1", res.at("/matches/0/docID").asText());
+        assertEquals("match-doc-1-p0-1", res.at("/matches/0/ID").asText());
+        assertEquals("<span class=\"context-left\"></span><mark>a</mark><span class=\"context-right\">bab</span>", res.at("/matches/0/snippet").asText());
     };
 
-
     @Test
     public void checkJSONTokenResult () throws Exception  {
-	KorapIndex ki = new KorapIndex();
-	FieldDocument fd = new FieldDocument();
-	fd.addString("ID", "doc-1");
-	fd.addString("UID", "1");
-	fd.addTV("base",
-		 "abab",
-		 "[(0-1)s:a|i:a|_0#0-1|-:t$<i>4]" +
-		 "[(1-2)s:b|i:b|_1#1-2]" +
-		 "[(2-3)s:a|i:c|_2#2-3]" +
-		 "[(3-4)s:b|i:a|_3#3-4]");
-	ki.addDoc(fd);
-	fd = new FieldDocument();
-	fd.addString("ID", "doc-2");
-	fd.addString("UID", "2");
-	fd.addTV("base",
-		 "aba",
-		 "[(0-1)s:a|i:a|_0#0-1|-:t$<i>3]" +
-		 "[(1-2)s:b|i:b|_1#1-2]" +
-		 "[(2-3)s:a|i:c|_2#2-3]");
-	ki.addDoc(fd);
+        KorapIndex ki = new KorapIndex();
+        FieldDocument fd = new FieldDocument();
+        fd.addString("ID", "doc-1");
+        fd.addString("UID", "1");
+        fd.addTV("base",
+                 "abab",
+                 "[(0-1)s:a|i:a|_0#0-1|-:t$<i>4]" +
+                 "[(1-2)s:b|i:b|_1#1-2]" +
+                 "[(2-3)s:a|i:c|_2#2-3]" +
+                 "[(3-4)s:b|i:a|_3#3-4]");
+        ki.addDoc(fd);
+        fd = new FieldDocument();
+        fd.addString("ID", "doc-2");
+        fd.addString("UID", "2");
+        fd.addTV("base",
+                 "aba",
+                 "[(0-1)s:a|i:a|_0#0-1|-:t$<i>3]" +
+                 "[(1-2)s:b|i:b|_1#1-2]" +
+                 "[(2-3)s:a|i:c|_2#2-3]");
+        ki.addDoc(fd);
+        
+        // Commit!
+        ki.commit();
 
-	// Commit!
-	ki.commit();
+        KorapQuery kq = new KorapQuery("base");
+        SpanQuery q = (SpanQuery) kq.seq(kq.seg("s:a")).append(kq.seg("s:b")).toQuery();
+        KorapResult kr = ki.search(q);
 
-	KorapQuery kq = new KorapQuery("base");
-	SpanQuery q = (SpanQuery) kq.seq(kq.seg("s:a")).append(kq.seg("s:b")).toQuery();
-	KorapResult kr = ki.search(q);
+        assertEquals((long) 3, kr.getTotalResults());
+        ObjectMapper mapper = new ObjectMapper();
+        JsonNode res = mapper.readTree(kr.toTokenListJsonString());
+        assertEquals(3, res.at("/totalResults").asInt());
+        assertEquals("spanNext(base:s:a, base:s:b)", res.at("/serialQuery").asText());
+        assertEquals(0, res.at("/startIndex").asInt());
+        assertEquals(25, res.at("/itemsPerPage").asInt());
 
-	assertEquals((long) 3, kr.getTotalResults());
-	ObjectMapper mapper = new ObjectMapper();
-	JsonNode res = mapper.readTree(kr.toTokenListJsonString());
-	assertEquals(3, res.at("/totalResults").asInt());
-	assertEquals("spanNext(base:s:a, base:s:b)", res.at("/serialQuery").asText());
-	assertEquals(0, res.at("/startIndex").asInt());
-	assertEquals(25, res.at("/itemsPerPage").asInt());
+        assertEquals("doc-1", res.at("/matches/0/textSigle").asText());
+        assertEquals(0, res.at("/matches/0/tokens/0/0").asInt());
+        assertEquals(1, res.at("/matches/0/tokens/0/1").asInt());
+        assertEquals(1, res.at("/matches/0/tokens/1/0").asInt());
+        assertEquals(2, res.at("/matches/0/tokens/1/1").asInt());
 
-	assertEquals("doc-1", res.at("/matches/0/textSigle").asText());
-	assertEquals(0, res.at("/matches/0/tokens/0/0").asInt());
-	assertEquals(1, res.at("/matches/0/tokens/0/1").asInt());
-	assertEquals(1, res.at("/matches/0/tokens/1/0").asInt());
-	assertEquals(2, res.at("/matches/0/tokens/1/1").asInt());
+        assertEquals("doc-1", res.at("/matches/1/textSigle").asText());
+        assertEquals(2, res.at("/matches/1/tokens/0/0").asInt());
+        assertEquals(3, res.at("/matches/1/tokens/0/1").asInt());
+        assertEquals(3, res.at("/matches/1/tokens/1/0").asInt());
+        assertEquals(4, res.at("/matches/1/tokens/1/1").asInt());
 
-	assertEquals("doc-1", res.at("/matches/1/textSigle").asText());
-	assertEquals(2, res.at("/matches/1/tokens/0/0").asInt());
-	assertEquals(3, res.at("/matches/1/tokens/0/1").asInt());
-	assertEquals(3, res.at("/matches/1/tokens/1/0").asInt());
-	assertEquals(4, res.at("/matches/1/tokens/1/1").asInt());
-
-	assertEquals("doc-2", res.at("/matches/2/textSigle").asText());
-	assertEquals(0, res.at("/matches/2/tokens/0/0").asInt());
-	assertEquals(1, res.at("/matches/2/tokens/0/1").asInt());
-	assertEquals(1, res.at("/matches/2/tokens/1/0").asInt());
-	assertEquals(2, res.at("/matches/2/tokens/1/1").asInt());
+        assertEquals("doc-2", res.at("/matches/2/textSigle").asText());
+        assertEquals(0, res.at("/matches/2/tokens/0/0").asInt());
+        assertEquals(1, res.at("/matches/2/tokens/0/1").asInt());
+        assertEquals(1, res.at("/matches/2/tokens/1/0").asInt());
+        assertEquals(2, res.at("/matches/2/tokens/1/1").asInt());
     };
-
+    
     public static String getString (String path) {
-	StringBuilder contentBuilder = new StringBuilder();
-	try {
-	    BufferedReader in = new BufferedReader(new FileReader(path));
-	    String str;
-	    while ((str = in.readLine()) != null) {
-		contentBuilder.append(str);
-	    };
-	    in.close();
-	} catch (IOException e) {
-	    fail(e.getMessage());
-	}
-	return contentBuilder.toString();
+        StringBuilder contentBuilder = new StringBuilder();
+        try {
+            BufferedReader in = new BufferedReader(new FileReader(path));
+            String str;
+            while ((str = in.readLine()) != null) {
+                contentBuilder.append(str);
+            };
+            in.close();
+        } catch (IOException e) {
+            fail(e.getMessage());
+        }
+        return contentBuilder.toString();
     };
 };
diff --git a/src/test/java/de/ids_mannheim/korap/search/TestKorapSearch.java b/src/test/java/de/ids_mannheim/korap/search/TestKrill.java
similarity index 95%
rename from src/test/java/de/ids_mannheim/korap/search/TestKorapSearch.java
rename to src/test/java/de/ids_mannheim/korap/search/TestKrill.java
index a13f0bc..3079718 100644
--- a/src/test/java/de/ids_mannheim/korap/search/TestKorapSearch.java
+++ b/src/test/java/de/ids_mannheim/korap/search/TestKrill.java
@@ -5,7 +5,7 @@
 
 import static de.ids_mannheim.korap.TestSimple.*;
 
-import de.ids_mannheim.korap.KorapSearch;
+import de.ids_mannheim.korap.Krill;
 import de.ids_mannheim.korap.KorapCollection;
 import de.ids_mannheim.korap.KorapQuery;
 import de.ids_mannheim.korap.KorapIndex;
@@ -29,10 +29,10 @@
 import org.junit.runners.JUnit4;
 
 @RunWith(JUnit4.class)
-public class TestKorapSearch {
+public class TestKrill {
     @Test
     public void searchCount () {
-        KorapSearch ks = new KorapSearch(
+        Krill ks = new Krill(
             new KorapQuery("field1").seg("a").with("b")
         );
         // Count:
@@ -48,7 +48,7 @@
 
     @Test
     public void searchStartIndex () {
-        KorapSearch ks = new KorapSearch(
+        Krill ks = new Krill(
             new KorapQuery("field1").seg("a").with("b")
         );
         // startIndex
@@ -66,7 +66,7 @@
 
     @Test
     public void searchQuery () {
-        KorapSearch ks = new KorapSearch(
+        Krill ks = new Krill(
             new KorapQuery("field1").seg("a").with("b")
         );
         // query
@@ -93,7 +93,7 @@
         };
         ki.commit();
 
-        KorapSearch ks = new KorapSearch(
+        Krill ks = new Krill(
 	        new KorapQuery("tokens").seg("s:Buchstaben")
         );
         ks.getCollection().filter(
@@ -135,7 +135,7 @@
             getClass().getResource("/queries/metaquery3.jsonld").getFile()
         );
 
-        KorapSearch ks = new KorapSearch(json);
+        Krill ks = new Krill(json);
 		KorapResult kr = ks.apply(ki);
         assertEquals(kr.getTotalResults(), 66);
         assertEquals(5, kr.getItemsPerPage());
@@ -177,12 +177,12 @@
             getClass().getResource("/queries/metaquery4.jsonld").getFile()
         );
 
-        KorapSearch ks = new KorapSearch(json);
+        Krill ks = new Krill(json);
         KorapResult kr = ks.apply(ki);
 
         assertEquals(kr.getTotalResults(), 1);
 
-        ks = new KorapSearch(json);
+        ks = new Krill(json);
         // Ignore the collection part of the query!
         ks.setCollection(new KorapCollection());
         kr = ks.apply(ki);
@@ -193,14 +193,14 @@
             getClass().getResource("/queries/metaquery5.jsonld").getFile()
         );
 
-        ks = new KorapSearch(json);
+        ks = new Krill(json);
         kr = ks.apply(ki);
         assertEquals(kr.getTotalResults(), 1);
 
         json = getString(
             getClass().getResource("/queries/metaquery6.jsonld").getFile()
         );
-        ks = new KorapSearch(json);
+        ks = new Krill(json);
         kr = ks.apply(ki);
         assertEquals(kr.getTotalResults(), 1);
     };
@@ -225,7 +225,7 @@
             );
         };
         ki.commit();
-        KorapResult kr = new KorapSearch("{ query").apply(ki);
+        KorapResult kr = new Krill("{ query").apply(ki);
         assertEquals(kr.getTotalResults(), 0);
         assertEquals(kr.getError(0).getMessage(), "Unable to parse JSON");
     };
@@ -254,7 +254,7 @@
             getClass().getResource("/queries/bsp-fail1.jsonld").getFile()
         );
 
-        KorapResult kr = new KorapSearch(json).apply(ki);
+        KorapResult kr = new Krill(json).apply(ki);
         assertEquals(0, kr.getStartIndex());
         assertEquals(kr.getTotalResults(), 0);
         assertEquals(25, kr.getItemsPerPage());
@@ -284,7 +284,7 @@
             getClass().getResource("/queries/bsp-fail2.jsonld").getFile()
         );
 
-        KorapResult kr = new KorapSearch(json).apply(ki);
+        KorapResult kr = new Krill(json).apply(ki);
         assertEquals(50, kr.getItemsPerPage());
         assertEquals(49950, kr.getStartIndex());
         assertEquals(kr.getTotalResults(), 0);
@@ -314,7 +314,7 @@
             getClass().getResource("/queries/bsp-context.jsonld").getFile()
         );
 
-        KorapSearch ks = new KorapSearch(json);
+        Krill ks = new Krill(json);
         KorapResult kr = ks.apply(ki);
         assertEquals(kr.getTotalResults(), 10);
         assertEquals("A bzw. a ist der erste Buchstabe des" +
@@ -334,7 +334,8 @@
             getClass().getResource("/queries/bsp-context-2.jsonld").getFile()
         );
 
-        kr = new KorapSearch(json).apply(ki);
+        kr = new Krill(json).apply(ki);
+
         assertEquals(kr.getTotalResults(), -1);
         assertEquals("... lls seit den Griechen beibehalten worden." +
                      " 3. Bedeutungen in der Biologie steht A für"+
@@ -373,7 +374,7 @@
             getClass().getResource("/queries/bsp-paging.jsonld").getFile()
         );
 
-        KorapSearch ks = new KorapSearch(json);
+        Krill ks = new Krill(json);
         KorapResult kr = ks.apply(ki);
         assertEquals(kr.getTotalResults(), 10);
         assertEquals(5, kr.getStartIndex());
@@ -382,7 +383,7 @@
         json = getString(
             getClass().getResource("/queries/bsp-cutoff.jsonld").getFile()
         );
-        ks = ks = new KorapSearch(json);
+        ks = ks = new Krill(json);
         kr = ks.apply(ki);
         assertEquals(kr.getTotalResults(), -1);
         assertEquals(2, kr.getStartIndex());
@@ -421,7 +422,7 @@
             getFile()
         );
 
-        KorapSearch ks = new KorapSearch(json);
+        Krill ks = new Krill(json);
         KorapResult kr = ks.apply(ki);
         assertEquals(kr.getTotalResults(), 10);
         assertEquals(0, kr.getStartIndex());
@@ -434,7 +435,7 @@
         assertEquals("WPD_AAA.00002", kr.getMatch(8).getDocID());
         assertEquals("WPD_AAA.00004", kr.getMatch(9).getDocID());
 
-        ks = new KorapSearch(json);
+        ks = new Krill(json);
         ks.setItemsPerResource(1);
 
         kr = ks.apply(ki);
@@ -447,7 +448,7 @@
         assertEquals(0, kr.getStartIndex());
         assertEquals(20, kr.getItemsPerPage());
         
-        ks = new KorapSearch(json);
+        ks = new Krill(json);
         ks.setItemsPerResource(2);
 
         kr = ks.apply(ki);
@@ -462,7 +463,7 @@
         assertEquals(0, kr.getStartIndex());
         assertEquals(20, kr.getItemsPerPage());
 
-        ks = new KorapSearch(json);
+        ks = new Krill(json);
         ks.setItemsPerResource(1);
         ks.setStartIndex(1);
         ks.setCount(1);
@@ -510,7 +511,7 @@
             getFile()
         );
 
-        KorapSearch ks = new KorapSearch(json);
+        Krill ks = new Krill(json);
         ks.setItemsPerResource(1);
         KorapCollection kc = new KorapCollection();
         kc.filterUIDs(new String[]{"1", "4"});
@@ -599,7 +600,7 @@
         assertNull(fd.getDocEditor());
         assertNull(fd.getDocAuthor());
 
-        KorapSearch ks = new KorapSearch(
+        Krill ks = new Krill(
             new KorapQuery("tokens").
             seg("mate/m:case:nom").
             with("mate/m:number:pl")
@@ -690,7 +691,7 @@
         assertNull(fd.getDocEditor());
         assertNull(fd.getDocAuthor());
         
-        KorapSearch ks = new KorapSearch(
+        Krill ks = new Krill(
             new KorapQuery("tokens").
             seg("mate/m:case:nom").
             with("mate/m:number:sg")
@@ -724,7 +725,7 @@
         );
 
         KorapQuery kq = new KorapQuery("tokens");
-        KorapSearch ks = new KorapSearch(
+        Krill ks = new Krill(
             kq.focus(
                 1,
                 kq.contains(kq.tag("base/s:s"), kq._(1, kq.seg("s:Leben")))
@@ -743,7 +744,7 @@
         );
 
         // Try with high class - don't highlight
-        ks = new KorapSearch(
+        ks = new Krill(
             kq.focus(
                 129,
                 kq.contains(kq.tag("base/s:s"), kq._(129, kq.seg("s:Leben")))
@@ -761,7 +762,7 @@
             "[Leben] gerufen hatten. Pressemeldungen zufolge haben sich ..."
         );
 
-        ks = new KorapSearch(json);
+        ks = new Krill(json);
         kr = ks.apply(ki);
         assertEquals(
             kr.getSerialQuery(),
@@ -806,7 +807,7 @@
             getFile()
         );
 	
-        KorapSearch ks = new KorapSearch(json);
+        Krill ks = new Krill(json);
         KorapResult kr = ks.apply(ki);
         assertEquals(
             kr.getSerialQuery(),
@@ -851,7 +852,7 @@
             getFile()
         );
 	
-        KorapSearch ks = new KorapSearch(json);
+        Krill ks = new Krill(json);
         KorapResult kr = ks.apply(ki);
 
         ObjectMapper mapper = new ObjectMapper();
@@ -902,7 +903,7 @@
             getFile()
         );
 	
-        KorapSearch ks = new KorapSearch(json);
+        Krill ks = new Krill(json);
         KorapCollection kc = ks.getCollection();
 
         // No index was set
@@ -985,7 +986,7 @@
             getFile()
         );
 	
-        KorapSearch ks = new KorapSearch(json);
+        Krill ks = new Krill(json);
         KorapResult kr = ks.apply(ki);
         assertEquals(kr.getTotalResults(), 276);
         assertEquals(0, kr.getStartIndex());
@@ -997,7 +998,7 @@
             getFile()
         );
 	
-        ks = new KorapSearch(json);
+        ks = new Krill(json);
         kr = ks.apply(ki);
 
         assertEquals(kr.getTotalResults(), 147);
@@ -1011,7 +1012,7 @@
             getFile()
         );
 	
-        ks = new KorapSearch(json);
+        ks = new Krill(json);
         kr = ks.apply(ki);
 
         assertEquals(kr.getTotalResults(), 28);
@@ -1025,7 +1026,7 @@
             getFile()
         );
 	
-        ks = new KorapSearch(json);
+        ks = new Krill(json);
         kr = ks.apply(ki);
 
         assertEquals(kr.getTotalResults(), 0);
@@ -1038,7 +1039,7 @@
             getFile()
         );
 	
-        ks = new KorapSearch(json);
+        ks = new Krill(json);
         kr = ks.apply(ki);
 
         assertEquals("filter with QueryWrapperFilter("+
@@ -1079,7 +1080,7 @@
             getFile()
         );
 	
-        KorapSearch ks = new KorapSearch(json);
+        Krill ks = new Krill(json);
         ks.setCutOff(false);
         SearchContext sc = ks.getContext();
         sc.left.setLength((short) 10);
@@ -1101,7 +1102,7 @@
             getFile()
         );
 
-        kr = new KorapSearch(json).apply(ki);
+        kr = new Krill(json).apply(ki);
         assertEquals(
             kr.getMatch(0).getSnippetBrackets(),
             "steht a für den dezimalen [Wert] 97 sowohl im ASCII-"+
@@ -1150,7 +1151,7 @@
             getFile()
         );
 
-        KorapResult kr = new KorapSearch(json).apply(ki);
+        KorapResult kr = new Krill(json).apply(ki);
 
         assertEquals(
             kr.getError(0).getMessage(),
@@ -1183,7 +1184,7 @@
             getFile()
         );
 	
-		KorapResult kr = new KorapSearch(json).apply(ki);				
+		KorapResult kr = new Krill(json).apply(ki);				
 		assertEquals("... Buchstabe des Alphabetes. In Dänemark ist " +
                      "[der alte Digraph Aa durch Å] ersetzt worden, " +
                      "in Eigennamen und Ortsnamen ...",
@@ -1199,7 +1200,7 @@
             getFile()
         );
 	
-		kr = new KorapSearch(json).apply(ki);
+		kr = new Krill(json).apply(ki);
 		
 		assertEquals("... Buchstabe des Alphabetes. In Dänemark ist " +
                      "[der alte Digraph Aa durch Å] ersetzt worden, " +
@@ -1229,7 +1230,7 @@
             getFile()
         );
 	
-		kr = new KorapSearch(json).apply(ki);
+		kr = new Krill(json).apply(ki);
 		
 		assertEquals("... Buchstabe des Alphabetes. In Dänemark ist " +
                      "[der alte Digraph Aa durch Å] ersetzt worden, " +
@@ -1245,7 +1246,7 @@
             getFile()
         );
 	
-		kr = new KorapSearch(json).apply(ki);	
+		kr = new Krill(json).apply(ki);	
 		assertEquals("... Buchstabe des Alphabetes. In Dänemark ist " +
                      "[der alte Digraph Aa durch Å] ersetzt worden, " +
                      "in Eigennamen und Ortsnamen ...",
diff --git a/src/test/java/de/ids_mannheim/korap/search/TestMetaFields.java b/src/test/java/de/ids_mannheim/korap/search/TestMetaFields.java
index 4074176..f8994b0 100644
--- a/src/test/java/de/ids_mannheim/korap/search/TestMetaFields.java
+++ b/src/test/java/de/ids_mannheim/korap/search/TestMetaFields.java
@@ -5,7 +5,7 @@
 
 import static de.ids_mannheim.korap.TestSimple.*;
 
-import de.ids_mannheim.korap.KorapSearch;
+import de.ids_mannheim.korap.Krill;
 import de.ids_mannheim.korap.KorapCollection;
 import de.ids_mannheim.korap.KorapQuery;
 import de.ids_mannheim.korap.KorapIndex;
@@ -48,7 +48,7 @@
             getClass().getResource("/queries/metas/fields.jsonld").getFile()
         );
 	
-        KorapSearch ks = new KorapSearch(jsonString);
+        Krill ks = new Krill(jsonString);
 
         KorapResult kr = ks.apply(ki);
         assertEquals((long) 17, kr.getTotalResults());
@@ -75,7 +75,7 @@
         jsonString = getString(
             getClass().getResource("/queries/metas/fields_2.jsonld").getFile()
         );
-        ks = new KorapSearch(jsonString);
+        ks = new Krill(jsonString);
         kr = ks.apply(ki);
         assertEquals((long) 17, kr.getTotalResults());
         assertEquals(0, kr.getStartIndex());
