diff --git a/Changes b/Changes
index 781c546..38f5e09 100644
--- a/Changes
+++ b/Changes
@@ -3,7 +3,9 @@
 	- [cleanup] Extract KrillMeta from Krill,
 	  rename KorapQuery to KrillQuery,
 	  extract QueryBuilder from KrillQuery,
-	  renamed KorapIndexer to index/Indexer (diewald)
+	  renamed KorapIndexer to index/Indexer,
+	  renamed KorapDocument to model/AbstractDocument,
+	  renamed KorapMatch to response/Match (diewald)
         - [documentation] Improved documentation for API classes (diewald)
 
 0.50 2015-02-23
diff --git a/pom.xml b/pom.xml
index 5d4440a..e0febda 100644
--- a/pom.xml
+++ b/pom.xml
@@ -15,6 +15,7 @@
          (This is not the preferred way to index new data!)
       # install the indexer
       $ mvn clean compile assembly:single
+
       # Then run e.g.
       $ java -jar target/Krill-X.XX.jar
              src/main/resources/korap.conf
diff --git a/src/main/java/de/ids_mannheim/korap/KorapIndex.java b/src/main/java/de/ids_mannheim/korap/KorapIndex.java
index 5efe1e6..528868f 100644
--- a/src/main/java/de/ids_mannheim/korap/KorapIndex.java
+++ b/src/main/java/de/ids_mannheim/korap/KorapIndex.java
@@ -30,6 +30,7 @@
 import de.ids_mannheim.korap.*;
 import de.ids_mannheim.korap.index.*;
 import de.ids_mannheim.korap.meta.*;
+import de.ids_mannheim.korap.response.Match;
 import de.ids_mannheim.korap.query.SpanElementQuery;
 import de.ids_mannheim.korap.util.QueryException;
 
@@ -612,7 +613,7 @@
     };
 
 
-    public KorapMatch getMatch (String id) throws QueryException {
+    public Match getMatch (String id) throws QueryException {
         return this.getMatchInfo(
             id,       // MatchID
             "tokens", // field
@@ -627,7 +628,7 @@
 
 
     // There is a good chance that some of these methods will die ...
-    public KorapMatch getMatchInfo (String id,
+    public Match getMatchInfo (String id,
                                     String field,
                                     String foundry,
                                     String layer,
@@ -646,7 +647,7 @@
     };
 
 
-    public KorapMatch getMatchInfo (String id,
+    public Match getMatchInfo (String id,
                                     String field,
                                     String foundry,
                                     String layer,
@@ -665,7 +666,7 @@
         );
     };
 
-    public KorapMatch getMatchInfo (String id,
+    public Match getMatchInfo (String id,
                                     String field,
                                     boolean info,
                                     String foundry,
@@ -696,10 +697,10 @@
      * Get a match.
      */
     /*
-      KorapInfo is associated with a KorapMatch and has an array with all informations
+      KorapInfo is associated with a Match and has an array with all informations
       per position in the match.
     */
-    public KorapMatch getMatchInfo (String idString,
+    public Match getMatchInfo (String idString,
                                     String field,
                                     boolean info,
                                     List<String> foundry,
@@ -708,7 +709,7 @@
                                     boolean includeHighlights,
                                     boolean extendToSentence) throws QueryException {
 
-        KorapMatch match = new KorapMatch(idString, includeHighlights);
+        Match match = new Match(idString, includeHighlights);
 
         if (this.getVersion() != null)
             match.setVersion(this.getVersion());
@@ -1194,8 +1195,8 @@
         };
 
         // Collect matches from atomic readers
-        ArrayList<KorapMatch> atomicMatches =
-            new ArrayList<KorapMatch>(kr.getItemsPerPage());
+        ArrayList<Match> atomicMatches =
+            new ArrayList<Match>(kr.getItemsPerPage());
         
         // Start time out thread
         TimeOutThread tthread = new TimeOutThread();
@@ -1285,8 +1286,8 @@
                     // Do not load all of this, in case the doc is the same!
                     Document doc = lreader.document(localDocID, fields);
 
-                    // Create new KorapMatch
-                    KorapMatch match = new KorapMatch(
+                    // Create new Match
+                    Match match = new Match(
                         pto,
                         localDocID,
                         spans.start(),
@@ -1409,7 +1410,7 @@
         HashSet<String> fields = new HashSet<>(1);
         fields.add("UID");
 
-        // List<KorapMatch> atomicMatches = new ArrayList<KorapMatch>(10);
+        // List<Match> atomicMatches = new ArrayList<Match>(10);
         try {
 
             // Rewrite query (for regex and wildcard queries)
@@ -1444,7 +1445,7 @@
                     // New match
                     // MatchIdentifier possibly needs more
                     /*
-                      KorapMatch match = new KorapMatch();
+                      Match match = new Match();
                       match.setStartPos(spans.start());
                       match.setEndPos(spans.end());
                       
diff --git a/src/main/java/de/ids_mannheim/korap/KorapResult.java b/src/main/java/de/ids_mannheim/korap/KorapResult.java
index 40232ae..20d2149 100644
--- a/src/main/java/de/ids_mannheim/korap/KorapResult.java
+++ b/src/main/java/de/ids_mannheim/korap/KorapResult.java
@@ -12,7 +12,9 @@
 
 // Remove:
 import de.ids_mannheim.korap.meta.SearchContext;
+
 import de.ids_mannheim.korap.response.KorapResponse;
+import de.ids_mannheim.korap.response.Match;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -43,7 +45,7 @@
     private int startIndex = 0;
     private String serialQuery;
 
-    private List<KorapMatch> matches;
+    private List<Match> matches;
 
     private SearchContext context;
 
@@ -54,8 +56,8 @@
     private JsonNode request;
 
     // Logger
-    // This is KorapMatch instead of KorapResult!
-    private final static Logger log = LoggerFactory.getLogger(KorapMatch.class);
+    // This is Match instead of KorapResult!
+    private final static Logger log = LoggerFactory.getLogger(Match.class);
 
 
     /**
@@ -96,9 +98,9 @@
     /**
      * Add a new match to the result set.
      *
-     * @param match A {@link KorapMatch} to add.
+     * @param match A {@link Match} to add.
      */
-    public void add (KorapMatch km) {
+    public void add (Match km) {
         this.matches.add(km);
     };
 
@@ -195,24 +197,24 @@
 
 
     /**
-     * Get a certain {@link KorapMatch} by index.
+     * Get a certain {@link Match} by index.
      *
      * @param index The numerical index of the match,
      *        starts with <tt>0</tt>.
-     * @return The {@link KorapMatch} object.
+     * @return The {@link Match} object.
      */
     @JsonIgnore
-    public KorapMatch getMatch (int index) {
+    public Match getMatch (int index) {
         return this.matches.get(index);
     };
 
 
     /**
-     * Get the list of {@link KorapMatch} matches.
+     * Get the list of {@link Match} matches.
      *
-     * @return The list of {@link KorapMatch} objects.
+     * @return The list of {@link Match} objects.
      */
-    public List<KorapMatch> getMatches() {
+    public List<Match> getMatches() {
         return this.matches;
     };
 
@@ -306,7 +308,7 @@
         int i = 1;
 
         // Add matches as bracket strings
-        for (KorapMatch km : this.getMatches())
+        for (Match km : this.getMatches())
             sb.append(i++)
                 .append(": ")
                 .append(km.getSnippetBrackets())
@@ -326,7 +328,7 @@
         ArrayNode array = json.putArray("matches");
 	
         // Add matches as token lists
-        for (KorapMatch km : this.getMatches())
+        for (Match km : this.getMatches())
             array.add(km.toTokenList());
 
         try {
diff --git a/src/main/java/de/ids_mannheim/korap/index/MatchCollector.java b/src/main/java/de/ids_mannheim/korap/index/MatchCollector.java
index 982002f..577dd86 100644
--- a/src/main/java/de/ids_mannheim/korap/index/MatchCollector.java
+++ b/src/main/java/de/ids_mannheim/korap/index/MatchCollector.java
@@ -1,5 +1,5 @@
 package de.ids_mannheim.korap.index;
-import de.ids_mannheim.korap.KorapMatch;
+import de.ids_mannheim.korap.response.Match;
 import de.ids_mannheim.korap.response.KorapResponse;
 import java.util.*;
 
diff --git a/src/main/java/de/ids_mannheim/korap/index/SpanInfo.java b/src/main/java/de/ids_mannheim/korap/index/SpanInfo.java
index 0314dc1..b8d5ea5 100644
--- a/src/main/java/de/ids_mannheim/korap/index/SpanInfo.java
+++ b/src/main/java/de/ids_mannheim/korap/index/SpanInfo.java
@@ -1,6 +1,6 @@
 package de.ids_mannheim.korap.index;
 import de.ids_mannheim.korap.index.TermInfo;
-import de.ids_mannheim.korap.KorapMatch;
+import de.ids_mannheim.korap.response.Match;
 import de.ids_mannheim.korap.index.PositionsToOffset;
 
 
@@ -16,71 +16,69 @@
     int localDocID;
 
     // Logger
-    private final static Logger log = LoggerFactory.getLogger(KorapMatch.class);
-        // This advices the java compiler to ignore all loggings
+    private final static Logger log = LoggerFactory.getLogger(Match.class);
+    // This advices the java compiler to ignore all loggings
     public static final boolean DEBUG = false;
 
-
     public SpanInfo (PositionsToOffset pto, int localDocID) {
-	this.terms      = new ArrayList<TermInfo>(64);
-	this.startChar  = new HashMap<Integer,Integer>(16);
-	this.endChar    = new HashMap<Integer,Integer>(16);
-	this.pto        = pto;
-	this.localDocID = localDocID;
+        this.terms      = new ArrayList<TermInfo>(64);
+        this.startChar  = new HashMap<Integer,Integer>(16);
+        this.endChar    = new HashMap<Integer,Integer>(16);
+        this.pto        = pto;
+        this.localDocID = localDocID;
     };
 
     public void add (TermInfo info) {
-	info.analyze();
-	if (info.getType() != "pos") {
-	    this.terms.add(info);
-	}
-	else {
-	    this.startChar.put(info.getStartPos(), info.getStartChar());
-	    this.endChar.put(info.getEndPos(), info.getEndChar());
-	};
+        info.analyze();
+        if (info.getType() != "pos") {
+            this.terms.add(info);
+        }
+        else {
+            this.startChar.put(info.getStartPos(), info.getStartChar());
+            this.endChar.put(info.getEndPos(), info.getEndChar());
+        };
     };
 
     public ArrayList<TermInfo> getTerms () {
+        // Sort terms (this will also analyze them!)
+        Collections.sort(this.terms);
+        boolean found;
 
-	// Sort terms (this will also analyze them!)
-	Collections.sort(this.terms);
-	boolean found;
+        // Add character offset information to terms that are
+        // missing this information
+        for (TermInfo t : this.terms) {
+            if (DEBUG)
+                log.trace("Check offsets for {} and {}", t.getStartPos(), t.getEndPos());
+            found = true;
+            if (t.getStartChar() == -1) {
+                if (this.startChar.containsKey(t.getStartPos()))
+                    t.setStartChar(this.startChar.get(t.getStartPos()));
+                else
+                    found = false;
+            }
+            if (t.getEndChar() == -1) {
+                if (this.endChar.containsKey(t.getEndPos()))
+                    t.setEndChar(this.endChar.get(t.getEndPos()));
+                else
+                    found = false;
+            };
+            
+            // Add this to found offsets
+            if (found && t.getStartPos() == t.getEndPos())
+                this.pto.addOffset(
+                    this.localDocID,
+                    t.getStartPos(),
+                    t.getStartChar(),
+                    t.getEndChar()
+                );
+            else {
+                if (DEBUG)
+                    log.trace("{} can't be found!", t.getAnnotation());
+                this.pto.add(this.localDocID, t.getStartPos());
+                this.pto.add(this.localDocID, t.getStartPos());
+            };
+        };
 
-	// Add character offset information to terms that are
-	// missing this information
-	for (TermInfo t : this.terms) {
-	    if (DEBUG)
-		log.trace("Check offsets for {} and {}", t.getStartPos(), t.getEndPos());
-	    found = true;
-	    if (t.getStartChar() == -1) {
-		if (this.startChar.containsKey(t.getStartPos()))
-		    t.setStartChar(this.startChar.get(t.getStartPos()));
-		else
-		    found = false;
-	    }
-	    if (t.getEndChar() == -1) {
-		if (this.endChar.containsKey(t.getEndPos()))
-		    t.setEndChar(this.endChar.get(t.getEndPos()));
-		else
-		    found = false;
-	    };
-
-	    // Add this to found offsets
-	    if (found && t.getStartPos() == t.getEndPos())
-	        this.pto.addOffset(
-	            this.localDocID,
-		    t.getStartPos(),
-		    t.getStartChar(),
-		    t.getEndChar()
-	        );
-	    else {
-		if (DEBUG)
-		    log.trace("{} can't be found!", t.getAnnotation());
-		this.pto.add(this.localDocID, t.getStartPos());
-		this.pto.add(this.localDocID, t.getStartPos());
-	    };
-	};
-
-	return this.terms;
+        return this.terms;
     };
 };
diff --git a/src/main/java/de/ids_mannheim/korap/index/TermInfo.java b/src/main/java/de/ids_mannheim/korap/index/TermInfo.java
index cc3d12a..2835be3 100644
--- a/src/main/java/de/ids_mannheim/korap/index/TermInfo.java
+++ b/src/main/java/de/ids_mannheim/korap/index/TermInfo.java
@@ -4,7 +4,7 @@
 import java.nio.ByteBuffer;
 import java.lang.StringBuffer;
 import java.util.regex.*;
-import de.ids_mannheim.korap.KorapMatch;
+import de.ids_mannheim.korap.response.Match;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -12,7 +12,7 @@
 public class TermInfo implements Comparable<TermInfo> {
 
     // Logger
-    private final static Logger log = LoggerFactory.getLogger(KorapMatch.class);
+    private final static Logger log = LoggerFactory.getLogger(Match.class);
     // This advices the java compiler to ignore all loggings
     public static final boolean DEBUG = false;
 
@@ -25,114 +25,116 @@
     private boolean analyzed = false;
 
     private int startChar = -1,
-	        endChar   = -1,
-	        startPos  = -1,
-	        endPos    = -1;
+        endChar   = -1,
+        startPos  = -1,
+        endPos    = -1;
 
     private byte depth = (byte) 0;
-
+    
     private Pattern prefixRegex = Pattern.compile("(?:([^/]+)/)?([^:/]+)(?::(.+?))?");
     private Matcher matcher;
 
     public TermInfo (String term, int pos, ByteBuffer payload) {
-	this.term     = term;
-	this.startPos = pos;
-	this.endPos   = pos;
-	this.payload  = payload;
+        this.term     = term;
+        this.startPos = pos;
+        this.endPos   = pos;
+        this.payload  = payload;
     };
 
     public TermInfo analyze () {
-	if (analyzed)
-	    return this;
+        if (analyzed)
+            return this;
 
-	int ttype = 0;
-	String tterm = this.term;
-	int lastPos = this.payload.position();
-	this.payload.rewind();
+        int ttype = 0;
+        String tterm = this.term;
+        int lastPos = this.payload.position();
+        this.payload.rewind();
 
-	switch (tterm.charAt(0)) {
-	case '<':
-	    // "<>:mate/l:..."
-	    if (tterm.charAt(1) == '>') {
-	    // span
-		this.type = "span";
-		tterm = tterm.substring(3);
-		ttype = 2;
-	    }
-	    // rel-target
- 	    else {
-		this.type = "relTarget";
-		tterm = tterm.substring(2);
-		ttype = 3;
-	    };
-	    break;
-	case '>':
-	    // rel-src
-	    this.type = "relSrc";
-	    tterm = tterm.substring(2);
-	    ttype = 3;
-	    break;
+        switch (tterm.charAt(0)) {
+        case '<':
+            // "<>:mate/l:..."
+            if (tterm.charAt(1) == '>') {
+                // span
+                this.type = "span";
+                tterm = tterm.substring(3);
+                ttype = 2;
+            }
+            // rel-target
+            else {
+                this.type = "relTarget";
+                tterm = tterm.substring(2);
+                ttype = 3;
+            };
+            break;
 
-	case '_':
-	    // pos
-	    this.type = "pos";
-	    ttype = 1;
-	    tterm = tterm.substring(1);
-	    break;
-	default:
-	    // term
-	    this.type = "term";
-	};
+        case '>':
+            // rel-src
+            this.type = "relSrc";
+            tterm = tterm.substring(2);
+            ttype = 3;
+            break;
+            
+        case '_':
+            // pos
+            this.type = "pos";
+            ttype = 1;
+            tterm = tterm.substring(1);
+            break;
 
-	// Analyze term value
-	if (ttype != 1) {
-	    if (DEBUG)
-		log.trace("Check {} for {}", tterm, prefixRegex.toString());
-	    matcher = prefixRegex.matcher(tterm);
-	    if (matcher.matches() && matcher.groupCount() == 3) {
-		this.annotation = tterm;
-		if (matcher.group(1) != null)
-		    this.foundry = matcher.group(1);
-		else
-		    this.foundry = "base";
-		this.layer   = matcher.group(2);
-		this.value   = matcher.group(3);
-	    };
-	}
+        default:
+            // term
+            this.type = "term";
+        };
 
-	// for positions
-	else {
-	    this.value = tterm;
-	    this.startChar = this.payload.getInt();
-	    this.endChar   = this.payload.getInt();
-	};
+        // Analyze term value
+        if (ttype != 1) {
+            if (DEBUG)
+                log.trace("Check {} for {}", tterm, prefixRegex.toString());
+            matcher = prefixRegex.matcher(tterm);
+            if (matcher.matches() && matcher.groupCount() == 3) {
+                this.annotation = tterm;
+                if (matcher.group(1) != null)
+                    this.foundry = matcher.group(1);
+                else
+                    this.foundry = "base";
+                this.layer   = matcher.group(2);
+                this.value   = matcher.group(3);
+            };
+        }
 
-	// for spans
-	if (ttype == 2) {
-	    this.startChar = this.payload.getInt();
-	    this.endChar   = this.payload.getInt();
-	};
+        // for positions
+        else {
+            this.value = tterm;
+            this.startChar = this.payload.getInt();
+            this.endChar   = this.payload.getInt();
+        };
+        
+        // for spans
+        if (ttype == 2) {
+            this.startChar = this.payload.getInt();
+            this.endChar   = this.payload.getInt();
+        };
 
-	// for spans and relations
-	if (ttype > 1)
-	    // Unsure if this is correct
-	    this.endPos = this.payload.getInt() -1;
-
-	if (ttype == 2 && this.payload.position() < lastPos) {
-	    this.depth = this.payload.get();
-	};
-
-	// payloads can have different meaning
-	analyzed = true;
-	return this;
+        // for spans and relations
+        if (ttype > 1)
+            // Unsure if this is correct
+            this.endPos = this.payload.getInt() -1;
+        
+        if (ttype == 2 && this.payload.position() < lastPos) {
+            this.depth = this.payload.get();
+        };
+        
+        // payloads can have different meaning
+        analyzed = true;
+        return this;
     };
 
     public String getType () {
-	return this.type;
+        return this.type;
     };
 
     public int getStartChar () {
-	return this.startChar;
+        return this.startChar;
     };
 
     public void setStartChar (int pos) {
@@ -140,7 +142,7 @@
     };
 
     public int getEndChar () {
-	return this.endChar;
+        return this.endChar;
     };
 
     public void setEndChar (int pos) {
@@ -148,74 +150,74 @@
     };
 
     public int getStartPos () {
-	return this.startPos;
+        return this.startPos;
     };
 
     public int getEndPos () {
-	return this.endPos;
+        return this.endPos;
     };
 
     public byte getDepth () {
-	return this.depth;
+        return this.depth;
     };
 
     public String getFoundry () {
-	return this.foundry;
+        return this.foundry;
     };
 
     public String getLayer () {
-	return this.layer;
+        return this.layer;
     };
 
     public String getValue () {
-	return this.value;
+        return this.value;
     };
 
     public String getAnnotation () {
-	return this.annotation;
+        return this.annotation;
     };
 
     public String toString () {
-	this.analyze();
+        this.analyze();
 
-	StringBuffer sb = new StringBuffer();
-	sb.append('<').append(this.getType()).append('>');
-	sb.append(this.getFoundry()).append('/').append(this.getLayer());
+        StringBuffer sb = new StringBuffer();
+        sb.append('<').append(this.getType()).append('>');
+        sb.append(this.getFoundry()).append('/').append(this.getLayer());
 
-	if (this.getValue() != null)
-	    sb.append(':').append(this.getValue());
+        if (this.getValue() != null)
+            sb.append(':').append(this.getValue());
 
-	if (this.getDepth() != (byte) 0)
-	    sb.append('(').append(this.getDepth()).append(')');
+        if (this.getDepth() != (byte) 0)
+            sb.append('(').append(this.getDepth()).append(')');
 
-	sb.append('[').append(this.getStartPos());
-	sb.append('-').append(this.getEndPos()).append(']');
-	sb.append('[').append(this.getStartChar());
-	sb.append('-').append(this.getEndChar()).append(']');
+        sb.append('[').append(this.getStartPos());
+        sb.append('-').append(this.getEndPos()).append(']');
+        sb.append('[').append(this.getStartChar());
+        sb.append('-').append(this.getEndChar()).append(']');
 
-	return sb.toString();
+        return sb.toString();
     };
 
     @Override
     public int compareTo (TermInfo obj) {
-	this.analyze();
-	obj.analyze();
+        this.analyze();
+        obj.analyze();
 
-	// TODO: This sorting does not seem to work!
-	// although it might only be important for depth stuff.
+        // TODO: This sorting does not seem to work!
+        // although it might only be important for depth stuff.
 
-	if (this.startChar < obj.startChar) {
-	    return -1;
-	}
-	else if (this.startChar > obj.startChar) {
-	    return 1;
-	}
-	else if (this.depth < obj.depth) {
-	    return 1;
-	}
-	else if (this.depth > obj.depth) {
-	    return -1;
-	};
-	return 0;
+        if (this.startChar < obj.startChar) {
+            return -1;
+        }
+        else if (this.startChar > obj.startChar) {
+            return 1;
+        }
+        else if (this.depth < obj.depth) {
+            return 1;
+        }
+        else if (this.depth > obj.depth) {
+            return -1;
+        };
+        return 0;
     };
 };
diff --git a/src/main/java/de/ids_mannheim/korap/index/collector/MatchCollectorDB.java b/src/main/java/de/ids_mannheim/korap/index/collector/MatchCollectorDB.java
index 10650dd..1bbf33b 100644
--- a/src/main/java/de/ids_mannheim/korap/index/collector/MatchCollectorDB.java
+++ b/src/main/java/de/ids_mannheim/korap/index/collector/MatchCollectorDB.java
@@ -1,6 +1,6 @@
 package de.ids_mannheim.korap.index.collector;
 import de.ids_mannheim.korap.KorapNode;
-import de.ids_mannheim.korap.KorapMatch;
+import de.ids_mannheim.korap.response.Match;
 import de.ids_mannheim.korap.index.MatchCollector;
 import com.fasterxml.jackson.annotation.*;
 import java.sql.Connection;
@@ -35,46 +35,46 @@
      * Create a new collector for database connections
      */
     public MatchCollectorDB (int bufferSize, String resultID) {
-	this.bufferSize = bufferSize;
-	this.resultID = resultID;
-	this.matchCollector = new ArrayList<int[]>(bufferSize + 2);
+        this.bufferSize = bufferSize;
+        this.resultID = resultID;
+        this.matchCollector = new ArrayList<int[]>(bufferSize + 2);
     };
 
     /*
      * Add matches till the bufferSize exceeds - then commit to the database.
      */
     public void add (int UID, int matchCount) {
-	if (this.docCollect == bufferSize)
-	    this.commit();
+        if (this.docCollect == bufferSize)
+            this.commit();
 
-	this.incrTotalResultDocs(1);
-	this.incrTotalResults(matchCount);
-	this.matchCollector.add(new int[]{UID, matchCount});
-	this.docCollect++;
+        this.incrTotalResultDocs(1);
+        this.incrTotalResults(matchCount);
+        this.matchCollector.add(new int[]{UID, matchCount});
+        this.docCollect++;
     };
 
     @JsonIgnore
     public void setDatabaseType (String type) {
-	this.databaseType = type;
+        this.databaseType = type;
     };
 
     @JsonIgnore
     public String getDatabaseType () {
-	return this.databaseType;
+        return this.databaseType;
     };
 
     @JsonIgnore
     public void setDBPool (String type, DataSource ds, Connection conn) throws SQLException {
-	this.setDatabaseType(type);
-	this.connection = conn;
-	this.pool = ds;
+        this.setDatabaseType(type);
+        this.connection = conn;
+        this.pool = ds;
     };
 
 
     @JsonIgnore
     public void setDBPool (String type, DataSource ds) throws SQLException {
-	this.setDatabaseType(type);
-	this.pool = ds;
+        this.setDatabaseType(type);
+        this.pool = ds;
     };
     /*
       Create prepared statement for multiple requests
@@ -88,95 +88,94 @@
     
     /* TODO: Ensure the commit was successful! */
     public void commit () {	
-	if (this.pool == null)
-	    return;
+        if (this.pool == null)
+            return;
 
-	try {
+        try {
 	    /*
 	     * This should be heavily optimized! It's aweful!
 	     * ARGHHHHHHH!
 	     */
+            if (this.connection.isClosed())
+                this.connection = this.pool.getConnection();
 
-	    if (this.connection.isClosed())
-		this.connection = this.pool.getConnection();
+            StringBuilder sb = new StringBuilder();
+            sb.append("INSERT INTO ")
+                .append(this.resultID)
+                .append(" (text_id, match_count) ");
+            
+            // SQLite batch insertion idiom
+            if (this.getDatabaseType().equals("sqlite")) {
+                for (int i = 1; i < this.docCollect; i++) {
+                    sb.append("SELECT ?, ? UNION ");
+                }
+                if (this.docCollect == 1)
+                    sb.append("VALUES (?, ?)");
+                else
+                    sb.append("SELECT ?, ?");
+            }
 
-	    StringBuilder sb = new StringBuilder();
-	    sb.append("INSERT INTO ")
-		.append(this.resultID)
-		.append(" (text_id, match_count) ");
+            // MySQL batch insertion idiom
+            else if (this.getDatabaseType().equals("mysql")) {
+                sb.append(" VALUES ");
+                for (int i = 1; i < this.docCollect; i++) {
+                    sb.append("(?,?),");
+                };
+                sb.append("(?,?)");
+            }
+            
+            // Unknown idiom
+            else {
+                log.error("Unsupported Database type");
+                return;
+            };
 
-	    // SQLite batch insertion idiom
-	    if (this.getDatabaseType().equals("sqlite")) {
-		for (int i = 1; i < this.docCollect; i++) {
-		    sb.append("SELECT ?, ? UNION ");
-		}
-		if (this.docCollect == 1)
-		    sb.append("VALUES (?, ?)");
-		else
-		    sb.append("SELECT ?, ?");
-	    }
+            // Prepare statement based on the string
+            PreparedStatement prep = this.connection.prepareStatement(sb.toString());
 
-	    // MySQL batch insertion idiom
-	    else if (this.getDatabaseType().equals("mysql")) {
-		sb.append(" VALUES ");
-		for (int i = 1; i < this.docCollect; i++) {
-		    sb.append("(?,?),");
-		};
-		sb.append("(?,?)");
-	    }
+            int i = 1;
+            ListIterator li = this.matchCollector.listIterator(); 
+            while (li.hasNext()) {
+                int[] v = (int[]) li.next();
+                prep.setInt(i++, v[0]);
+                prep.setInt(i++, v[1]);
+            };
 
-	    // Unknown idiom
-	    else {
-		log.error("Unsupported Database type");
-		return;
-	    };
+            prep.addBatch();
+            prep.executeBatch();
+            this.connection.commit();
+        }
 
-	    // Prepare statement based on the string
-	    PreparedStatement prep = this.connection.prepareStatement(sb.toString());
+        // An SQL error occured ...
+        catch (SQLException e) {
+            log.error(e.getLocalizedMessage());
+        };
 
-	    int i = 1;
-	    ListIterator li = this.matchCollector.listIterator(); 
-	    while (li.hasNext()) {
-		int[] v = (int[]) li.next();
-		prep.setInt(i++, v[0]);
-		prep.setInt(i++, v[1]);
-	    };
-
-	    prep.addBatch();
-	    prep.executeBatch();
-	    this.connection.commit();
-	}
-
-	// An SQL error occured ...
-	catch (SQLException e) {
-	    log.error(e.getLocalizedMessage());
-	};
-
-	this.matchCollector.clear();
-	this.docCollect = 0;
-	return;
+        this.matchCollector.clear();
+        this.docCollect = 0;
+        return;
     };
 
     /*
      * Close collector and connection
      */
     public void close () {
-	this.commit();
-	try {
-	    this.connection.close();
-	}
+        this.commit();
+        try {
+            this.connection.close();
+        }
        	catch (SQLException e) {
-	    log.warn(e.getLocalizedMessage());
-	}
+            log.warn(e.getLocalizedMessage());
+        }
     };
 
     /*
      * Close collector and probably connection
      */
     public void close (boolean close) {
-	if (close)
-	    this.close();
-	else
-	    this.commit();
+        if (close)
+            this.close();
+        else
+            this.commit();
     };
 };
diff --git a/src/main/java/de/ids_mannheim/korap/match/HighlightCombinator.java b/src/main/java/de/ids_mannheim/korap/match/HighlightCombinator.java
index d379d94..43ba8cd 100644
--- a/src/main/java/de/ids_mannheim/korap/match/HighlightCombinator.java
+++ b/src/main/java/de/ids_mannheim/korap/match/HighlightCombinator.java
@@ -1,6 +1,6 @@
 package de.ids_mannheim.korap.match;
 
-import de.ids_mannheim.korap.KorapMatch;
+import de.ids_mannheim.korap.response.Match;
 import de.ids_mannheim.korap.match.HighlightCombinatorElement;
 import java.util.*;
 import java.io.*;
@@ -13,8 +13,8 @@
 */
 public class HighlightCombinator {
 
-    // Logger (use the KorapMatch class)
-    private final static Logger log = LoggerFactory.getLogger(KorapMatch.class);
+    // Logger (use the Match class)
+    private final static Logger log = LoggerFactory.getLogger(Match.class);
 
     // This advices the java compiler to ignore all loggings
     public static final boolean DEBUG = false;
@@ -25,161 +25,161 @@
 
     // Empty constructor
     public HighlightCombinator () {
-	this.combine = new LinkedList<>();
+        this.combine = new LinkedList<>();
     };
 
     // Return the combination list
     public LinkedList<HighlightCombinatorElement> list () {
-	return this.combine;
+        return this.combine;
     };
 
     // get the first element (without removing)
     public HighlightCombinatorElement getFirst () {
-	return this.combine.getFirst();
+        return this.combine.getFirst();
     };
 
     // get the last element (without removing)
     public HighlightCombinatorElement getLast () {
-	return this.combine.getLast();
+        return this.combine.getLast();
     };
 
     // get an element by index (without removing)
     public HighlightCombinatorElement get (int index) {
-	return this.combine.get(index);
+        return this.combine.get(index);
     };
 
     // Get the size of the combinator stack
     public short size () {
-	return (short) this.combine.size();
+        return (short) this.combine.size();
     };
 
     // Add primary data to the stack
     public void addString (String characters) {
-	this.combine.add(new HighlightCombinatorElement(characters));
+        this.combine.add(new HighlightCombinatorElement(characters));
     };
 
     // Add opening highlight combinator to the stack
     public void addOpen (int number) {
-	this.combine.add(new HighlightCombinatorElement((byte) 1, number));
-	this.balanceStack.push(number);
+        this.combine.add(new HighlightCombinatorElement((byte) 1, number));
+        this.balanceStack.push(number);
     };
 
     // Add closing highlight combinator to the stack
     public void addClose (int number) {
-	HighlightCombinatorElement lastComb;
+        HighlightCombinatorElement lastComb;
 
-	// Clean up temporary stack
-	this.tempStack.clear();
+        // Clean up temporary stack
+        this.tempStack.clear();
+        
+        // Check if there is an opening tag at least
+        if (this.balanceStack.empty()) {
+            if (DEBUG)
+                log.trace("The balance stack is empty");
+            return;
+        };
 
-	// Check if there is an opening tag at least
-	if (this.balanceStack.empty()) {
-	    if (DEBUG)
-		log.trace("The balance stack is empty");
-	    return;
-	};
+        // Just some debug information
+        if (DEBUG) {
+            StringBuilder sb = new StringBuilder("Stack for checking with class ");
+            sb.append(number).append(" is ");
+            for (int s : this.balanceStack) {
+                sb.append('[').append(s).append(']');
+            };
+            log.trace(sb.toString());
+        };
 
-	// Just some debug information
-	if (DEBUG) {
-	    StringBuilder sb = new StringBuilder("Stack for checking with class ");
-	    sb.append(number).append(" is ");
-	    for (int s : this.balanceStack) {
-		sb.append('[').append(s).append(']');
-	    };
-	    log.trace(sb.toString());
-	};
+        // class number of the last element
+        // It's already ensured the stack is not empty
+        int eold = this.balanceStack.pop();
+        
+        // the closing element is not balanced, i.e. the last element differs
+        while (eold != number) {
+            
+            // Retrieve last combinator on stack
+            lastComb = this.combine.peekLast();
+            
+            if (DEBUG)
+                log.trace("Closing element is unbalanced - {} " +
+                          "!= {} with lastComb {}|{}|{}",
+                          eold,
+                          number,
+                          lastComb.type,
+                          lastComb.number,
+                          lastComb.characters);
 
-	// class number of the last element
-	// It's already ensured the stack is not empty
-	int eold = this.balanceStack.pop();
+            // combinator is opening and the number is not equal to the last
+            // element on the balanceStack
+            if (lastComb.type == 1 && lastComb.number == eold) {
+                
+                // Remove the last element - it's empty and uninteresting!
+                this.combine.removeLast();
+            }
 
-	// the closing element is not balanced, i.e. the last element differs
-	while (eold != number) {
+            // combinator is either closing (??) or another opener
+            else {
 
-	    // Retrieve last combinator on stack
-	    lastComb = this.combine.peekLast();
-
-	    if (DEBUG)
-		log.trace("Closing element is unbalanced - {} " +
-			  "!= {} with lastComb {}|{}|{}",
-			  eold,
-			  number,
-			  lastComb.type,
-			  lastComb.number,
-			  lastComb.characters);
-
-	    // combinator is opening and the number is not equal to the last
-	    // element on the balanceStack
-	    if (lastComb.type == 1 && lastComb.number == eold) {
+                if (DEBUG)
+                    log.trace("close element a) {}", eold);
 		
-		// Remove the last element - it's empty and uninteresting!
-		this.combine.removeLast();
-	    }
+                // Add a closer for the old element (this has following elements)
+                this.combine.add(new HighlightCombinatorElement((byte) 2, eold, false));
+            };
 
-	    // combinator is either closing (??) or another opener
-	    else {
+            // add this element number temporarily on the stack
+            tempStack.push(eold);
 
-		if (DEBUG)
-		    log.trace("close element a) {}", eold);
-		
-		// Add a closer for the old element (this has following elements)
-		this.combine.add(new HighlightCombinatorElement((byte) 2, eold, false));
-	    };
+            // Check next element
+            eold = this.balanceStack.pop();
+        };
 
-	    // add this element number temporarily on the stack
-	    tempStack.push(eold);
+        // Get last combinator on the stack
+        lastComb = this.combine.peekLast();
 
-	    // Check next element
-	    eold = this.balanceStack.pop();
-	};
-
-	// Get last combinator on the stack
-	lastComb = this.combine.peekLast();
-
-	if (DEBUG) {
-	    log.trace("LastComb: " +
-		      lastComb.type +
-		      '|' +
-		      lastComb.number +
-		      '|' + lastComb.characters +
-		      " for " +
-		      number);
-	    log.trace("Stack for checking 2: {}|{}|{}|{}",
-		      lastComb.type,
-		      lastComb.number,
-		      lastComb.characters,
-		      number);
-	};
-
-	if (lastComb.type == 1 && lastComb.number == number) {
-	    while (lastComb.type == 1 && lastComb.number == number) {
-		// Remove the damn thing - It's empty and uninteresting!
-		this.combine.removeLast();
-		lastComb = this.combine.peekLast();
-	    };
-	}
-	else {
-	    if (DEBUG)
-		log.trace("close element b) {}", number);
+        if (DEBUG) {
+            log.trace("LastComb: " +
+                      lastComb.type +
+                      '|' +
+                      lastComb.number +
+                      '|' + lastComb.characters +
+                      " for " +
+                      number);
+            log.trace("Stack for checking 2: {}|{}|{}|{}",
+                      lastComb.type,
+                      lastComb.number,
+                      lastComb.characters,
+                      number);
+        };
+        
+        if (lastComb.type == 1 && lastComb.number == number) {
+            while (lastComb.type == 1 && lastComb.number == number) {
+                // Remove the damn thing - It's empty and uninteresting!
+                this.combine.removeLast();
+                lastComb = this.combine.peekLast();
+            };
+        }
+        else {
+            if (DEBUG)
+                log.trace("close element b) {}", number);
 	    
-	    // Add a closer
-	    this.combine.add(new HighlightCombinatorElement((byte) 2, number));
-	};
+            // Add a closer
+            this.combine.add(new HighlightCombinatorElement((byte) 2, number));
+        };
 
-	// Fetch everything from the tempstack and reopen it
-	for (int e : tempStack) {
-	    if (DEBUG)
-		log.trace("Reopen element {}", e);
-	    combine.add(new HighlightCombinatorElement((byte) 1, e));
-	    balanceStack.push(e);
-	};
+        // Fetch everything from the tempstack and reopen it
+        for (int e : tempStack) {
+            if (DEBUG)
+                log.trace("Reopen element {}", e);
+            combine.add(new HighlightCombinatorElement((byte) 1, e));
+            balanceStack.push(e);
+        };
     };
 
     // Get all combined elements as a string
     public String toString () {
-	StringBuilder sb = new StringBuilder();
-	for (HighlightCombinatorElement e : combine) {
-	    sb.append(e.toString()).append("\n");
-	};
-	return sb.toString();
+        StringBuilder sb = new StringBuilder();
+        for (HighlightCombinatorElement e : combine) {
+            sb.append(e.toString()).append("\n");
+        };
+        return sb.toString();
     };
 };
diff --git a/src/main/java/de/ids_mannheim/korap/match/HighlightCombinatorElement.java b/src/main/java/de/ids_mannheim/korap/match/HighlightCombinatorElement.java
index dbd3e0a..ec0b3b4 100644
--- a/src/main/java/de/ids_mannheim/korap/match/HighlightCombinatorElement.java
+++ b/src/main/java/de/ids_mannheim/korap/match/HighlightCombinatorElement.java
@@ -1,7 +1,7 @@
 package de.ids_mannheim.korap.match;
 
 import org.apache.lucene.util.FixedBitSet;
-import de.ids_mannheim.korap.KorapMatch;
+import de.ids_mannheim.korap.response.Match;
 import de.ids_mannheim.korap.match.Relation;
 import static de.ids_mannheim.korap.util.KorapString.*;
 import java.util.*;
@@ -44,7 +44,7 @@
     };
 
     // Return html fragment for this combinator element
-    public String toHTML (KorapMatch match, FixedBitSet level, byte[] levelCache) {	    
+    public String toHTML (Match match, FixedBitSet level, byte[] levelCache) {	    
         // Opening
         if (this.type == 1) {
             StringBuilder sb = new StringBuilder();
@@ -114,7 +114,7 @@
     };
 
     // Return bracket fragment for this combinator element
-    public String toBrackets (KorapMatch match) {
+    public String toBrackets (Match match) {
 	if (this.type == 1) {
 	    StringBuilder sb = new StringBuilder();
 	    
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 ffeb6bf..27d4f2f 100644
--- a/src/main/java/de/ids_mannheim/korap/node/Resource.java
+++ b/src/main/java/de/ids_mannheim/korap/node/Resource.java
@@ -24,8 +24,8 @@
 import de.ids_mannheim.korap.KorapIndex;
 import de.ids_mannheim.korap.Krill;
 import de.ids_mannheim.korap.KorapCollection;
-import de.ids_mannheim.korap.KorapMatch;
 import de.ids_mannheim.korap.KorapResult;
+import de.ids_mannheim.korap.response.Match;
 import de.ids_mannheim.korap.response.KorapResponse;
 import de.ids_mannheim.korap.index.FieldDocument;
 import de.ids_mannheim.korap.util.QueryException;
@@ -410,15 +410,15 @@
 
 	    // Nothing found
 	    catch (QueryException qe) {
-		// Todo: Make KorapMatch rely on KorapResponse!
-                KorapMatch km = new KorapMatch();
+		// Todo: Make Match rely on KorapResponse!
+                Match km = new Match();
                 km.addError(qe.getErrorCode(), qe.getMessage());
                 return km.toJsonString();
             }
 	};
 
 	// Response with error message
-        KorapMatch km = new KorapMatch();
+        Match km = new Match();
         km.addError(601, "Unable to find index");
         return km.toJsonString();
     };
diff --git a/src/main/java/de/ids_mannheim/korap/KorapMatch.java b/src/main/java/de/ids_mannheim/korap/response/Match.java
similarity index 98%
rename from src/main/java/de/ids_mannheim/korap/KorapMatch.java
rename to src/main/java/de/ids_mannheim/korap/response/Match.java
index b8a04b3..521be0b 100644
--- a/src/main/java/de/ids_mannheim/korap/KorapMatch.java
+++ b/src/main/java/de/ids_mannheim/korap/response/Match.java
@@ -1,4 +1,4 @@
-package de.ids_mannheim.korap;
+package de.ids_mannheim.korap.response;
 import java.util.*;
 import java.io.*;
 
@@ -48,10 +48,10 @@
  * @see KorapResult
  */
 @JsonInclude(Include.NON_NULL)
-public class KorapMatch extends AbstractDocument {
+public class Match extends AbstractDocument {
 
     // Logger
-    private final static Logger log = LoggerFactory.getLogger(KorapMatch.class);
+    private final static Logger log = LoggerFactory.getLogger(Match.class);
 
     // This advices the java compiler to ignore all loggings
     public static final boolean DEBUG = false;
@@ -105,7 +105,7 @@
     private boolean processed = false;
 
     /**
-     * Constructs a new KorapMatch object.
+     * Constructs a new Match object.
      * Todo: Maybe that's not necessary!
      *
      * @param pto The PositionsToOffset object, containing relevant
@@ -118,7 +118,7 @@
      * @see #snippetBrackets()
      * @see PositionsToOffset
      */
-    public KorapMatch (PositionsToOffset pto,
+    public Match (PositionsToOffset pto,
 		       int localDocID,
 		       int startPos,
 		       int endPos) {
@@ -130,19 +130,19 @@
 
     
     /**
-     * Constructs a new KorapMatch object.
+     * Constructs a new Match object.
      */
-    public KorapMatch () {};
+    public Match () {};
 
     
     /**
-     * Constructs a new KorapMatch object.
+     * Constructs a new Match object.
      *
      * @param idString Match identifier string as provided by KorapResult.
      * @param includeHighlights Boolean value indicating if possible provided
      *        highlight information should be ignored or not.
      */
-    public KorapMatch (String idString, boolean includeHighlights) {
+    public Match (String idString, boolean includeHighlights) {
 	MatchIdentifier id = new MatchIdentifier(idString);
 	if (id.getStartPos() > -1) {
 	    this.setCorpusID(id.getCorpusID());
@@ -635,7 +635,7 @@
     };
 
 
-    public KorapMatch setContext (SearchContext context) {
+    public Match setContext (SearchContext context) {
 	this.context = context;
 	return this;
     };
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 c4a6dc5..9c1b399 100644
--- a/src/test/java/de/ids_mannheim/korap/highlight/TestClass.java
+++ b/src/test/java/de/ids_mannheim/korap/highlight/TestClass.java
@@ -11,7 +11,7 @@
 import org.junit.Test;
 
 import de.ids_mannheim.korap.KorapIndex;
-import de.ids_mannheim.korap.KorapMatch;
+import de.ids_mannheim.korap.response.Match;
 import de.ids_mannheim.korap.KrillQuery;
 import de.ids_mannheim.korap.KorapResult;
 import de.ids_mannheim.korap.Krill;
@@ -79,7 +79,7 @@
 		kr = ki.search(sq, (short) 10);
 				
 		/*
-		for (KorapMatch km : kr.getMatches()){
+		for (Match km : kr.getMatches()){
 			System.out.println(km.getStartPos() +","+km.getEndPos()+" "
 					+km.getSnippetBrackets()
 			);
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 79d49b0..6c0a32b 100644
--- a/src/test/java/de/ids_mannheim/korap/highlight/TestHighlight.java
+++ b/src/test/java/de/ids_mannheim/korap/highlight/TestHighlight.java
@@ -10,7 +10,7 @@
 import de.ids_mannheim.korap.query.QueryBuilder;
 import de.ids_mannheim.korap.KorapResult;
 import de.ids_mannheim.korap.Krill;
-import de.ids_mannheim.korap.KorapMatch;
+import de.ids_mannheim.korap.response.Match;
 import de.ids_mannheim.korap.index.FieldDocument;
 
 import de.ids_mannheim.korap.util.QueryException;
@@ -55,7 +55,7 @@
         KorapResult kr = ki.search(
             (SpanQuery) kq.seq(kq._(1, kq.seg("s:b"))).toQuery()
         );
-        KorapMatch km = kr.getMatch(0);
+        Match km = kr.getMatch(0);
         assertEquals(km.getStartPos(),  1);
         assertEquals(km.getEndPos(),    2);
         assertEquals(km.getStartPos(1), 1);
@@ -124,7 +124,7 @@
         QueryBuilder kq = new QueryBuilder("tokens");
 
         KorapResult kr = ki.search((SpanQuery) kq.seq(kq.seg("s:a")).append(kq.seg("s:b")).append(kq.seg("s:c")).toQuery());
-        KorapMatch km = kr.getMatch(0);
+        Match km = kr.getMatch(0);
         km.addHighlight(0, 1, (short) 7);
         assertEquals("<span class=\"context-left\"></span><mark><mark class=\"class-7 level-0\">ab</mark>c</mark><span class=\"context-right\"></span>", km.getSnippetHTML());
 
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 bebd2a9..8905440 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestElementDistanceIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestElementDistanceIndex.java
@@ -16,7 +16,7 @@
 import org.junit.runners.JUnit4;
 
 import de.ids_mannheim.korap.KorapIndex;
-import de.ids_mannheim.korap.KorapMatch;
+import de.ids_mannheim.korap.response.Match;
 import de.ids_mannheim.korap.KrillQuery;
 import de.ids_mannheim.korap.KorapResult;
 import de.ids_mannheim.korap.query.QueryBuilder;
@@ -230,7 +230,7 @@
         assertEquals(30, kr.getMatch(1).startPos);
         assertEquals(33, kr.getMatch(1).endPos);
         
-      /*  for (KorapMatch km : kr.getMatches()){		
+      /*  for (Match km : kr.getMatches()){		
         	System.out.println(km.getStartPos() +","+km.getEndPos()+" "
         			+km.getSnippetBrackets());
         }*/
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 62b2f41..b551db3 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestFieldDocument.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestFieldDocument.java
@@ -21,7 +21,7 @@
 import de.ids_mannheim.korap.KorapResult;
 import de.ids_mannheim.korap.Krill;
 import de.ids_mannheim.korap.KrillMeta;
-import de.ids_mannheim.korap.KorapMatch;
+import de.ids_mannheim.korap.response.Match;
 import de.ids_mannheim.korap.query.SpanNextQuery;
 import de.ids_mannheim.korap.query.SpanClassQuery;
 import de.ids_mannheim.korap.query.QueryBuilder;
@@ -138,7 +138,7 @@
 	QueryBuilder kq = new QueryBuilder("tokens");
 	KorapResult kr = ki.search((SpanQuery) kq.seq(kq._(3, kq.seg("s:b"))).toQuery());
 
-	KorapMatch km = kr.getMatch(0);
+	Match km = kr.getMatch(0);
 
 	assertEquals(km.getPrimaryData(),"abc");
 	assertEquals(km.getCorpusID(),"WPD");
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 cefb233..fd6ee8d 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestMatchCollector.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestMatchCollector.java
@@ -15,7 +15,7 @@
 
 import de.ids_mannheim.korap.KorapIndex;
 import de.ids_mannheim.korap.KrillQuery;
-import de.ids_mannheim.korap.KorapMatch;
+import de.ids_mannheim.korap.response.Match;
 import de.ids_mannheim.korap.index.MatchCollector;
 import de.ids_mannheim.korap.KorapCollection;
 import de.ids_mannheim.korap.Krill;
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 65f6679..ea86ab1 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestMatchIdentifier.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestMatchIdentifier.java
@@ -17,7 +17,7 @@
 import de.ids_mannheim.korap.Krill;
 import de.ids_mannheim.korap.query.QueryBuilder;
 import de.ids_mannheim.korap.KorapResult;
-import de.ids_mannheim.korap.KorapMatch;
+import de.ids_mannheim.korap.response.Match;
 import de.ids_mannheim.korap.util.QueryException;
 
 
@@ -102,7 +102,7 @@
 	assertEquals("StartPos (0)", kr.getMatch(0).startPos, 7);
 	assertEquals("EndPos (0)",   kr.getMatch(0).endPos,   9);
 
-	KorapMatch km = kr.getMatch(0);
+	Match km = kr.getMatch(0);
 
 	assertEquals("SnippetBrackets (0)", "... bcabca[{2:b{1:a}}]c", km.getSnippetBrackets());
 	assertEquals("ID (0)", "match-c1!d1-p7-9(2)7-8(1)8-8", km.getID());
@@ -114,7 +114,7 @@
 	ki.addDoc(createSimpleFieldDoc());
 	ki.commit();
 
-	KorapMatch km = ki.getMatch("match-c1!d1-p7-9(0)8-8(2)7-8");
+	Match km = ki.getMatch("match-c1!d1-p7-9(0)8-8(2)7-8");
 
 	assertEquals("StartPos (0)", 7, km.getStartPos());
 	assertEquals("EndPos (0)", 9, km.getEndPos());
@@ -217,7 +217,7 @@
 	ki.addDoc(createSimpleFieldDoc());
 	ki.commit();
 
-	KorapMatch km = ki.getMatchInfo("match-c1!d1-p7-9(4)8-8(2)7-8",
+	Match km = ki.getMatchInfo("match-c1!d1-p7-9(4)8-8(2)7-8",
 			     "tokens",
 			     null,
 			     null,
@@ -267,7 +267,7 @@
 	ki.addDoc(createSimpleFieldDoc());
 	ki.commit();
 
-	KorapMatch km = ki.getMatchInfo("match-c1!d1-p7-9(4)8-8(2)7-8",
+	Match km = ki.getMatchInfo("match-c1!d1-p7-9(4)8-8(2)7-8",
 			     "tokens",
 			     null,
 			     null,
@@ -313,7 +313,7 @@
 	ki.addDoc(createSimpleFieldDoc());
 	ki.commit();
 
-	KorapMatch km = ki.getMatchInfo("match-c1!d1-p7-9(4)8-8(2)7-8",
+	Match km = ki.getMatchInfo("match-c1!d1-p7-9(4)8-8(2)7-8",
 			     "tokens",
 			     null,
 			     null,
@@ -332,7 +332,7 @@
 	ki.addDoc(createSimpleFieldDoc());
 	ki.commit();
 
-	KorapMatch km = ki.getMatchInfo("match-c1!d1-p7-10(4)8-8(2)7-8",
+	Match km = ki.getMatchInfo("match-c1!d1-p7-10(4)8-8(2)7-8",
 			     "tokens",
 			     null,
 			     null,
@@ -351,7 +351,7 @@
 	ki.addDoc(createSimpleFieldDoc());
 	ki.commit();
 
-	KorapMatch km = ki.getMatchInfo("match-c1!d1-p7-10(4)8-8(2)7-8",
+	Match km = ki.getMatchInfo("match-c1!d1-p7-10(4)8-8(2)7-8",
 			     "tokens",
 			     null,
 			     null,
@@ -414,7 +414,7 @@
 	ki.addDoc(createSimpleFieldDoc());
 	ki.commit();
 
-	KorapMatch km = ki.getMatchInfo("match-c1!d1-p0-5(4)8-8(2)7-8",
+	Match km = ki.getMatchInfo("match-c1!d1-p0-5(4)8-8(2)7-8",
 			     "tokens",
 			     "x",
 			     null,
@@ -508,7 +508,7 @@
 	ki.addDoc(createSimpleFieldDoc3());
 	ki.addDoc(createSimpleFieldDoc4());
 	ki.commit();
-	KorapMatch km;
+	Match km;
 
 	km = ki.getMatchInfo("match-c1!d1-p3-4",
 			     "tokens",
@@ -562,7 +562,7 @@
 	ki.addDoc(createSimpleFieldDoc2());
 	ki.commit();
 
-	KorapMatch km = ki.getMatchInfo("match-c1!d1-p0-4",
+	Match km = ki.getMatchInfo("match-c1!d1-p0-4",
 			     "tokens",
 			     null,
 			     null,
@@ -623,7 +623,7 @@
 	ki.addDoc(createSimpleFieldDoc4());
 	ki.commit();
 
-	KorapMatch km = ki.getMatchInfo("match-c1!d4-p3-9",
+	Match km = ki.getMatchInfo("match-c1!d4-p3-9",
 					"tokens",
 					"f",
 					"m",
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestMatchIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestMatchIndex.java
index c1caa4a..ca98734 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestMatchIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestMatchIndex.java
@@ -15,9 +15,9 @@
 
 import de.ids_mannheim.korap.KorapIndex;
 import de.ids_mannheim.korap.KrillQuery;
-import de.ids_mannheim.korap.KorapMatch;
 import de.ids_mannheim.korap.KorapResult;
 import de.ids_mannheim.korap.KorapCollection;
+import de.ids_mannheim.korap.response.Match;
 import de.ids_mannheim.korap.query.*;
 import de.ids_mannheim.korap.index.FieldDocument;
 import de.ids_mannheim.korap.model.MultiTermTokenStream;
@@ -333,7 +333,7 @@
 
         assertEquals("totalResults", kr.getTotalResults(), 3);
 
-        KorapMatch km = kr.getMatch(0);
+        Match km = kr.getMatch(0);
         assertEquals("StartPos (0)", 1, km.startPos);
         assertEquals("EndPos (0)", 2, km.endPos);
         assertEquals("SnippetBrackets (0)", "a[{3:b}]cabcab ...", km.getSnippetBrackets());
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestNextIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestNextIndex.java
index 078d651..e3c325f 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestNextIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestNextIndex.java
@@ -15,7 +15,7 @@
 import org.junit.runners.JUnit4;
 
 import de.ids_mannheim.korap.KorapIndex;
-import de.ids_mannheim.korap.KorapMatch;
+import de.ids_mannheim.korap.response.Match;
 import de.ids_mannheim.korap.KrillQuery;
 import de.ids_mannheim.korap.KorapResult;
 import de.ids_mannheim.korap.query.SpanNextQuery;
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestRelationIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestRelationIndex.java
index 74c8cfe..4a9227f 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestRelationIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestRelationIndex.java
@@ -9,7 +9,7 @@
 import org.junit.Test;
 
 import de.ids_mannheim.korap.KorapIndex;
-import de.ids_mannheim.korap.KorapMatch;
+import de.ids_mannheim.korap.response.Match;
 import de.ids_mannheim.korap.KorapResult;
 import de.ids_mannheim.korap.query.SpanAttributeQuery;
 import de.ids_mannheim.korap.query.SpanElementQuery;
@@ -382,7 +382,7 @@
         assertEquals(5,kr.getMatch(6).getStartPos());
         assertEquals(7,kr.getMatch(6).getEndPos());     
         
-//       for (KorapMatch km : kr.getMatches()){        
+//       for (Match km : kr.getMatches()){        
 //            System.out.println(km.getStartPos() +","+km.getEndPos()
 //                    //  +" "+km.getSnippetBrackets()
 //            );
@@ -446,7 +446,7 @@
 				false, true, true); 
 		kr = ki.search(rv3,(short) 10);
 		
-		/*for (KorapMatch km : kr.getMatches()){		
+		/*for (Match km : kr.getMatches()){		
 			System.out.println(km.getStartPos() +","+km.getEndPos()+" "
 				+km.getSnippetBrackets()
 					);
@@ -478,7 +478,7 @@
 				false, true, true);
 		kr = ki.search(rv,(short) 10);
 		
-		/*for (KorapMatch km : kr.getMatches()){
+		/*for (Match km : kr.getMatches()){
 			System.out.println(km.getStartPos() +","+km.getEndPos()+" "
 				+km.getSnippetBrackets());
 			}*/
@@ -519,7 +519,7 @@
 				true, false, true);
 		kr = ki.search(rv,(short) 10);
 		
-		/*for (KorapMatch km : kr.getMatches()){
+		/*for (Match km : kr.getMatches()){
 			System.out.println(km.getStartPos() +","+km.getEndPos()+" "
 				+km.getSnippetBrackets());
 			}*/
@@ -551,7 +551,7 @@
 				new SpanElementQuery("base","np"), 
 				false, true, true);
 		kr = ki.search(rv,(short) 10);
-		/*for (KorapMatch km : kr.getMatches()){
+		/*for (Match km : kr.getMatches()){
 			System.out.println(km.getStartPos() +","+km.getEndPos()+" "
 				+km.getSnippetBrackets());
 			}*/
@@ -575,7 +575,7 @@
 				
 		kr = ki.search(rv3,(short) 10);
 		
-		/*for (KorapMatch km : kr.getMatches()){		
+		/*for (Match km : kr.getMatches()){		
 		System.out.println(km.getStartPos() +","+km.getEndPos()+" "
 			+km.getSnippetBrackets());
 		}*/		
@@ -652,7 +652,7 @@
 				false, true, true);
 		kr = ki.search(rv,(short) 10);
 		
-		/*for (KorapMatch km : kr.getMatches()){		
+		/*for (Match km : kr.getMatches()){		
 			System.out.println(km.getStartPos() +","+km.getEndPos()+" "
 				+km.getSnippetBrackets());
 			}*/
@@ -691,7 +691,7 @@
 				3, false, true, true);
 		kr = ki.search(rv,(short) 10);
 		
-		/*for (KorapMatch km : kr.getMatches()){
+		/*for (Match km : kr.getMatches()){
 			System.out.println(km.getStartPos() +","+km.getEndPos()
 				+" "+km.getSnippetBrackets()
 				);
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestRepetitionIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestRepetitionIndex.java
index 052dd0d..affd5a3 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestRepetitionIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestRepetitionIndex.java
@@ -11,7 +11,7 @@
 import org.junit.Test;
 
 import de.ids_mannheim.korap.KorapIndex;
-import de.ids_mannheim.korap.KorapMatch;
+import de.ids_mannheim.korap.response.Match;
 import de.ids_mannheim.korap.KorapResult;
 import de.ids_mannheim.korap.query.SpanNextQuery;
 import de.ids_mannheim.korap.query.SpanRepetitionQuery;
@@ -227,7 +227,7 @@
         assertEquals(77, kr.getMatch(0).getEndPos());
         assertEquals(74, kr.getMatch(1).getStartPos());
         assertEquals(77, kr.getMatch(1).getEndPos());
-       /* for (KorapMatch km : kr.getMatches()){
+       /* for (Match km : kr.getMatches()){
         	System.out.println(km.getSnippetBrackets());
         	System.out.println(km.getStartPos() +","+km.getEndPos());
         }*/
@@ -241,7 +241,7 @@
         assertEquals(73, kr.getMatch(0).getStartPos());
         assertEquals(77, kr.getMatch(0).getEndPos());
         /*
-        for (KorapMatch km : kr.getMatches()){
+        for (Match km : kr.getMatches()){
         	System.out.println(km.getSnippetBrackets());
         	System.out.println(km.getStartPos() +","+km.getEndPos());
         }*/
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 ad99e2c..7ec87db 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestSpanExpansionIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestSpanExpansionIndex.java
@@ -56,7 +56,7 @@
         assertEquals(8, kr.getMatch(2).getEndPos());
 
         /*
-         * for (KorapMatch km : kr.getMatches()) {
+         * for (Match km : kr.getMatches()) {
          * System.out.println(km.getStartPos() + "," + km.getEndPos() + " " +
          * km.getSnippetBrackets()); }
          */
@@ -101,7 +101,7 @@
         assertEquals(156, kr.getMatch(3).getEndPos(1));
 
         /*
-         * for (KorapMatch km : kr.getMatches()){
+         * for (Match km : kr.getMatches()){
          * System.out.println(km.getStartPos() +","+km.getEndPos()+" "
          * +km.getSnippetBrackets()); }
          */
@@ -127,7 +127,7 @@
         assertEquals(36, kr.getMatch(3).getEndPos(1));
 
         /*
-         * for (KorapMatch km : kr.getMatches()){
+         * for (Match km : kr.getMatches()){
          * System.out.println(km.getStartPos() +","+km.getEndPos()+" "
          * +km.getSnippetBrackets()); }
          */
@@ -161,7 +161,7 @@
         assertEquals(13, kr.getMatch(3).getEndPos(1));
 
         /*
-         * for (KorapMatch km : kr.getMatches()){
+         * for (Match km : kr.getMatches()){
          * System.out.println(km.getStartPos() +","+km.getEndPos()+" "
          * +km.getSnippetBrackets()); }
          */
@@ -201,7 +201,7 @@
         assertEquals(14, kr.getMatch(6).getEndPos(1));
 
         /*
-         * for (KorapMatch km : kr.getMatches()){
+         * for (Match km : kr.getMatches()){
          * System.out.println(km.getStartPos() +","+km.getEndPos()+" "
          * +km.getSnippetBrackets()); }
          */
@@ -240,7 +240,7 @@
         assertEquals(12, kr.getMatch(3).getEndPos());
 
         /*
-         * for (KorapMatch km : kr.getMatches()){
+         * for (Match km : kr.getMatches()){
          * System.out.println(km.getStartPos() +","+km.getEndPos()+" "
          * //+km.getSnippetBrackets() ); }
          */
@@ -302,7 +302,7 @@
         assertEquals(208, kr.getMatch(0).getEndPos());
 
         /*
-         * for (KorapMatch km : kr.getMatches()){
+         * for (Match km : kr.getMatches()){
          * System.out.println(km.getStartPos() +","+km.getEndPos()+" "
          * +km.getSnippetBrackets() ); }
          */
@@ -336,7 +336,7 @@
         assertEquals((long) 3, kr.getTotalResults());
 
         /*
-         * for (KorapMatch km : kr.getMatches()){
+         * for (Match km : kr.getMatches()){
          * System.out.println(km.getStartPos() +","+km.getEndPos()+" "
          * +km.getSnippetBrackets() ); }
          */
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestSubSpanIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestSubSpanIndex.java
index 4aff0bf..d6346f8 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestSubSpanIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestSubSpanIndex.java
@@ -51,7 +51,7 @@
         assertEquals(185, kr.getMatch(1).getEndPos());
 
         /*
-         * for (KorapMatch km : kr.getMatches()){
+         * for (Match km : kr.getMatches()){
          * System.out.println(km.getStartPos() +","+km.getEndPos()
          * +km.getSnippetBrackets()); }
          */
@@ -109,7 +109,7 @@
         assertEquals(183, kr.getMatch(1).getStartPos());
         assertEquals(185, kr.getMatch(1).getEndPos());
 
-        // for (KorapMatch km : kr.getMatches()) {
+        // for (Match km : kr.getMatches()) {
         // System.out.println(km.getStartPos() + "," + km.getEndPos()
         // + km.getSnippetBrackets());
         // }
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 25516e6..4775399 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestWPDIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestWPDIndex.java
@@ -15,7 +15,7 @@
 
 import de.ids_mannheim.korap.KorapCollection;
 import de.ids_mannheim.korap.KorapIndex;
-import de.ids_mannheim.korap.KorapMatch;
+import de.ids_mannheim.korap.response.Match;
 import de.ids_mannheim.korap.KorapResult;
 import de.ids_mannheim.korap.Krill;
 import de.ids_mannheim.korap.collection.BooleanFilter;
@@ -85,7 +85,7 @@
 		kr = ks.apply(ki);
 		assertEquals(kr.getTotalResults(), 11);
 		//System.out.println(kr.getTotalResults());
-		//for (KorapMatch km : kr.getMatches()){
+		//for (Match km : kr.getMatches()){
 			//System.out.println(km.getDocID() +" "+km.getStartPos() +" "+ km.getEndPos());
         	//System.out.println(km.getSnippetBrackets());
         	//System.out.println(km.toJSON());
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 e3a6a20..cb76846 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestWithinIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestWithinIndex.java
@@ -15,7 +15,7 @@
 import org.junit.runners.JUnit4;
 
 import de.ids_mannheim.korap.KorapIndex;
-import de.ids_mannheim.korap.KorapMatch;
+import de.ids_mannheim.korap.response.Match;
 import de.ids_mannheim.korap.KrillQuery;
 import de.ids_mannheim.korap.KorapResult;
 import de.ids_mannheim.korap.query.SpanElementQuery;
@@ -192,7 +192,7 @@
         assertEquals("Doc (11)", 1, kr.getMatch(11).internalDocID);
 
         /*
-		for (KorapMatch km : kr.getMatches()){		
+		for (Match km : kr.getMatches()){		
 			System.out.println(km.getStartPos() +","+km.getEndPos()+" "
                                +km.getSnippetBrackets());
 		};	
@@ -1116,7 +1116,7 @@
         assertEquals(252, kr.getMatch(1).getEndPos());
 
         /*
-		for (KorapMatch km : kr.getMatches()){		
+		for (Match km : kr.getMatches()){		
 			System.out.println(km.getStartPos() +","+km.getEndPos()+" "
                                +km.getSnippetBrackets());
 		};	
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 26452a9..875df5f 100644
--- a/src/test/java/de/ids_mannheim/korap/query/TestTemporaryQueryLimitations.java
+++ b/src/test/java/de/ids_mannheim/korap/query/TestTemporaryQueryLimitations.java
@@ -9,7 +9,7 @@
 import de.ids_mannheim.korap.KrillQuery;
 import de.ids_mannheim.korap.KorapResult;
 import de.ids_mannheim.korap.Krill;
-import de.ids_mannheim.korap.KorapMatch;
+import de.ids_mannheim.korap.response.Match;
 import de.ids_mannheim.korap.index.FieldDocument;
 
 import de.ids_mannheim.korap.util.QueryException;
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 b84d5f2..f065b83 100644
--- a/src/test/java/de/ids_mannheim/korap/search/TestKorapResult.java
+++ b/src/test/java/de/ids_mannheim/korap/search/TestKorapResult.java
@@ -10,7 +10,7 @@
 import de.ids_mannheim.korap.KrillQuery;
 import de.ids_mannheim.korap.KorapResult;
 import de.ids_mannheim.korap.Krill;
-import de.ids_mannheim.korap.KorapMatch;
+import de.ids_mannheim.korap.response.Match;
 import de.ids_mannheim.korap.query.QueryBuilder;
 import de.ids_mannheim.korap.index.FieldDocument;
 
