diff --git a/src/test/java/de/ids_mannheim/korap/TestSimple.java b/src/test/java/de/ids_mannheim/korap/TestSimple.java
index 041c381..91b54d5 100644
--- a/src/test/java/de/ids_mannheim/korap/TestSimple.java
+++ b/src/test/java/de/ids_mannheim/korap/TestSimple.java
@@ -117,7 +117,12 @@
 
         StringBuilder contentBuilder = new StringBuilder();
         try {			
-			BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(URLDecoder.decode(path, "UTF-8")), "UTF-8"));
+			BufferedReader in = new BufferedReader(
+				new InputStreamReader(
+					new FileInputStream(URLDecoder.decode(path, "UTF-8")),
+					"UTF-8"
+					)
+				);
             String str;
             while ((str = in.readLine()) != null) {
                 contentBuilder.append(str);
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 c4fabc3..04768b0 100644
--- a/src/test/java/de/ids_mannheim/korap/highlight/TestClass.java
+++ b/src/test/java/de/ids_mannheim/korap/highlight/TestClass.java
@@ -4,7 +4,7 @@
 import static org.junit.Assert.fail;
 
 import java.io.*;
-import java.net.URLDecoder;
+import static de.ids_mannheim.korap.TestSimple.*;
 
 import org.apache.lucene.search.spans.SpanQuery;
 import org.junit.Test;
@@ -28,10 +28,8 @@
     @Test
     public void queryJSONpoly1 () throws QueryException, IOException {
 
-        String jsonPath = URLDecoder.decode(
-                getClass().getResource("/queries/poly1.json").getFile(),
-                "UTF-8");
-        String jsonQuery = readFile(jsonPath);
+        String jsonPath = getClass().getResource("/queries/poly1.json").getFile();
+        String jsonQuery = getJsonString(jsonPath);
         SpanQueryWrapper sqwi = new KrillQuery("tokens").fromKoral(jsonQuery);
 
         SpanNextQuery sq = (SpanNextQuery) sqwi.toQuery();
@@ -64,10 +62,8 @@
     @Test
     public void queryJSONpoly4 () throws QueryException, IOException {
 
-        String jsonPath = URLDecoder.decode(
-                getClass().getResource("/queries/poly4.json").getFile(),
-                "UTF-8");
-        String jsonQuery = readFile(jsonPath);
+        String jsonPath = getClass().getResource("/queries/poly4.json").getFile();
+        String jsonQuery = getJsonString(jsonPath);
         SpanQueryWrapper sqwi = new KrillQuery("tokens").fromKoral(jsonQuery);
         SpanQuery sq = sqwi.toQuery();
 
@@ -94,21 +90,4 @@
 
         //fail("Tests have to be updated");
     }
-
-
-    private String readFile (String path) {
-        StringBuilder sb = new StringBuilder();
-        try {
-			BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(URLDecoder.decode(path, "UTF-8")), "UTF-8"));
-            String str;
-            while ((str = in.readLine()) != null) {
-                sb.append(str);
-            };
-            in.close();
-        }
-        catch (IOException e) {
-            fail(e.getMessage());
-        }
-        return sb.toString();
-    }
 }
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestElementDistanceIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestElementDistanceIndex.java
index f3c15a6..82b1dcb 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestElementDistanceIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestElementDistanceIndex.java
@@ -5,7 +5,7 @@
 
 import java.util.*;
 import java.io.*;
-import java.net.URLDecoder;
+import static de.ids_mannheim.korap.TestSimple.*;
 
 import org.apache.lucene.index.Term;
 import org.apache.lucene.search.spans.SpanQuery;
@@ -244,9 +244,7 @@
         ki.addDoc(getClass().getResourceAsStream("/wiki/00001.json.gz"), true);
         ki.commit();
 
-        String jsonPath = URLDecoder.decode(
-                getClass().getResource("/queries/cosmas1.json").getFile(),
-                "UTF-8");
+        String jsonPath = getClass().getResource("/queries/cosmas1.json").getFile();
         SpanQueryWrapper sqwi = jsonQuery(jsonPath);
         kr = ki.search(sqwi.toQuery(), (short) 10);
 
@@ -274,9 +272,8 @@
         assertEquals(kr.getTotalResults(), 1);
         assertEquals("[[ecebdc]]", kr.getMatch(0).getSnippetBrackets());
 
-        String jsonPath = URLDecoder.decode(getClass()
-                .getResource("/queries/distances/in-same-t.jsonld").getFile(),
-                "UTF-8");
+        String jsonPath = getClass()
+                .getResource("/queries/distances/in-same-t.jsonld").getFile();
         sqwi = jsonQuery(jsonPath);
 
         assertEquals(
@@ -288,29 +285,13 @@
         assertEquals("[[ec]]ebdc", kr.getMatch(0).getSnippetBrackets());
     }
 
-
-    public static String getString (String path) {
-        StringBuilder contentBuilder = new StringBuilder();
-        try {
-			BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(URLDecoder.decode(path, "UTF-8")), "UTF-8"));
-            String str;
-            while ((str = in.readLine()) != null) {
-                contentBuilder.append(str);
-            }
-            in.close();
-        }
-        catch (IOException e) {
-            fail(e.getMessage());
-        }
-        return contentBuilder.toString();
-    }
-
-
+	// TODO:
+	// probably replace with getJSONQuery()
     public static SpanQueryWrapper jsonQuery (String jsonFile) {
         SpanQueryWrapper sqwi;
 
         try {
-            String json = getString(jsonFile);
+            String json = getJsonString(jsonFile);
             sqwi = new KrillQuery("tokens").fromKoral(json);
         }
         catch (QueryException e) {
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 b94475d..81a6ef0 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestSpanExpansionIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestSpanExpansionIndex.java
@@ -4,7 +4,7 @@
 import static org.junit.Assert.fail;
 
 import java.io.*;
-import java.net.URLDecoder;
+import static de.ids_mannheim.korap.TestSimple.*;
 
 import org.apache.lucene.index.Term;
 import org.apache.lucene.search.RegexpQuery;
@@ -296,10 +296,8 @@
         ki.addDoc(getClass().getResourceAsStream("/wiki/00001.json.gz"), true);
         ki.addDoc(getClass().getResourceAsStream("/wiki/00002.json.gz"), true);
         ki.commit();
-        String jsonPath = URLDecoder.decode(
-                getClass().getResource("/queries/poly3.json").getFile(),
-                "UTF-8");
-        String jsonQuery = readFile(jsonPath);
+        String jsonPath = getClass().getResource("/queries/poly3.json").getFile();
+        String jsonQuery = getJsonString(jsonPath);
         SpanQueryWrapper sqwi = new KrillQuery("tokens").fromKoral(jsonQuery);
 
         SpanQuery sq = sqwi.toQuery();
@@ -396,10 +394,9 @@
         ki.addDoc(createFieldDoc3());
         ki.addDoc(createFieldDoc4());
         ki.commit();
-        String jsonPath = URLDecoder.decode(getClass()
-                .getResource("/queries/bugs/expansion_bug_3.jsonld").getFile(),
-                "UTF-8");
-        String json = readFile(jsonPath);
+        String jsonPath = getClass()
+                .getResource("/queries/bugs/expansion_bug_3.jsonld").getFile();
+        String json = getJsonString(jsonPath);
         KrillQuery kq = new KrillQuery("base");
         SpanQuery sq = kq.fromKoral(json).toQuery();
         assertEquals(sq.toString(),
@@ -571,22 +568,6 @@
         return fd;
     }
 
-    private String readFile (String path) {
-        StringBuilder sb = new StringBuilder();
-        try {
-			BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(URLDecoder.decode(path, "UTF-8")), "UTF-8"));
-            String str;
-            while ((str = in.readLine()) != null) {
-                sb.append(str);
-            }
-            in.close();
-        }
-        catch (IOException e) {
-            fail(e.getMessage());
-        }
-        return sb.toString();
-    }
-
     private Krill _newKrill (SpanQueryWrapper query) {
         Krill ks = new Krill(query);
         ks.getMeta().getContext().left.setToken(true).setLength(1);
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 8fd2e6b..5e06cfa 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestWithinIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestWithinIndex.java
@@ -5,6 +5,7 @@
 
 import java.io.*;
 import java.net.URLDecoder;
+import static de.ids_mannheim.korap.TestSimple.*;
 
 import org.apache.lucene.index.Term;
 import org.apache.lucene.search.spans.SpanQuery;
@@ -1102,10 +1103,8 @@
     // contains(<s>, (es wird | wird es))
     @Test
     public void queryJSONpoly2 () throws QueryException, IOException {
-        String jsonPath = URLDecoder.decode(
-                getClass().getResource("/queries/poly2.json").getFile(),
-                "UTF-8");
-        String jsonPQuery = readFile(jsonPath);
+        String jsonPath = getClass().getResource("/queries/poly2.json").getFile();
+        String jsonPQuery = getJsonString(jsonPath);
         SpanQueryWrapper sqwi = new KrillQuery("tokens").fromKoral(jsonPQuery);
 
         SpanWithinQuery sq = (SpanWithinQuery) sqwi.toQuery();
@@ -1140,10 +1139,9 @@
           at de.ids_mannheim.korap.Krill.apply(Krill.java:304)
         */
 
-        String jsonPath = URLDecoder.decode(getClass()
-                .getResource("/queries/bugs/span_or_bug.jsonld").getFile(),
-                "UTF-8");
-        String jsonPQuery = readFile(jsonPath);
+        String jsonPath = getClass()
+                .getResource("/queries/bugs/span_or_bug.jsonld").getFile();
+        String jsonPQuery = getJsonString(jsonPath);
         SpanQueryWrapper sqwi = new KrillQuery("tokens").fromKoral(jsonPQuery);
 
         SpanWithinQuery sq = (SpanWithinQuery) sqwi.toQuery();
@@ -1163,22 +1161,4 @@
         Result kr = ki.search(sq, (short) 1);
         assertEquals(1, kr.getTotalResults());
     }
-
-
-
-    private String readFile (String path) {
-        StringBuilder sb = new StringBuilder();
-        try {
-			BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(URLDecoder.decode(path, "UTF-8")), "UTF-8"));
-            String str;
-            while ((str = in.readLine()) != null) {
-                sb.append(str);
-            };
-            in.close();
-        }
-        catch (IOException e) {
-            fail(e.getMessage());
-        }
-        return sb.toString();
-    };
 };
diff --git a/src/test/java/de/ids_mannheim/korap/query/TestKrillQueryJSON.java b/src/test/java/de/ids_mannheim/korap/query/TestKrillQueryJSON.java
index d2d1f6b..3d65c62 100644
--- a/src/test/java/de/ids_mannheim/korap/query/TestKrillQueryJSON.java
+++ b/src/test/java/de/ids_mannheim/korap/query/TestKrillQueryJSON.java
@@ -2,9 +2,7 @@
 
 import java.util.*;
 import java.io.*;
-import java.net.URLDecoder;
-import java.nio.file.Path;
-import java.nio.file.Files;
+import static de.ids_mannheim.korap.TestSimple.*;
 
 import org.apache.lucene.search.spans.SpanQuery;
 import de.ids_mannheim.korap.query.wrap.SpanQueryWrapper;
@@ -418,7 +416,7 @@
     public void queryJSONunderspecifiedTokenBug () {
         // ((MORPH(APPR) ODER MORPH(APPRART)) /+w1 Urlaub
         try {
-            String json = getString(getClass()
+            String json = getJsonString(getClass()
                     .getResource("/queries/bugs/underspecified_token.jsonld")
                     .getFile());
             new KrillQuery("tokens").fromKoral(json);
@@ -489,21 +487,21 @@
     public void queryJSONflags2 () throws QueryException {
         // buchstabe/i
         try {
-            String json = getString(getClass()
+            String json = getJsonString(getClass()
                     .getResource("/queries/flags/unknown1.jsonld").getFile());
             KrillQuery kq = new KrillQuery("tokens");
             assertEquals(kq.fromKoral(json).toQuery().toString(),
                     "tokens:s:buchstabe");
             assertEquals(kq.getWarning(0).getCode(), 748);
 
-            json = getString(getClass()
+            json = getJsonString(getClass()
                     .getResource("/queries/flags/unknown2.jsonld").getFile());
             kq = new KrillQuery("tokens");
             assertEquals(kq.fromKoral(json).toQuery().toString(),
                     "tokens:i:buchstabe");
             assertEquals(kq.getWarning(0).getCode(), 748);
 
-            json = getString(getClass()
+            json = getJsonString(getClass()
                     .getResource("/queries/flags/unknown3.jsonld").getFile());
             kq = new KrillQuery("tokens");
             assertEquals(kq.fromKoral(json).toQuery().toString(),
@@ -521,7 +519,7 @@
     public void queryJSONelement () throws QueryException {
         // <base/s=s>
         try {
-            String json = getString(getClass()
+            String json = getJsonString(getClass()
                     .getResource("/queries/element/simple-element.jsonld")
                     .getFile());
             KrillQuery kq = new KrillQuery("tokens");
@@ -539,7 +537,7 @@
     public void queryJSONinfiniteExpansion () throws QueryException {
         // der []*
         try {
-            String json = getString(getClass()
+            String json = getJsonString(getClass()
                     .getResource("/queries/bugs/expansion_bug_3.jsonld")
                     .getFile());
             KrillQuery kq = new KrillQuery("tokens");
@@ -557,7 +555,7 @@
     public void queryJSONcomplexSpanOrTerm () throws QueryException {
         // startsWith(<base/s=s>, { lassen | laufen })
         try {
-            String json = getString(getClass()
+            String json = getJsonString(getClass()
                     .getResource("/queries/bugs/span_or_bug.jsonld").getFile());
             KrillQuery kq = new KrillQuery("tokens");
 
@@ -574,7 +572,7 @@
     public void queryJSONdistancesWithRegexes () throws QueryException {
         // "der" []{2,3} [opennlp/p="NN"]
         try {
-            String json = getString(getClass()
+            String json = getJsonString(getClass()
                     .getResource(
                             "/queries/bugs/distances_with_regex_bug.jsonld")
                     .getFile());
@@ -592,7 +590,7 @@
     @Test
     public void queryJSONregexRewrite1 () throws QueryException {
         // "der" [.+?]
-        String json = getString(getClass()
+        String json = getJsonString(getClass()
                 .getResource("/queries/sequence/regex-rewrite-1.jsonld")
                 .getFile());
         KrillQuery kq = new KrillQuery("tokens");
@@ -605,7 +603,7 @@
     @Test
     public void queryJSONmerge () throws QueryException {
         // treat merging gracefully
-        String json = getString(getClass()
+        String json = getJsonString(getClass()
                 .getResource("/queries/merge.jsonld")
                 .getFile());
         KrillQuery kq = new KrillQuery("tokens");
@@ -615,29 +613,12 @@
     };
 	
 
-    public static String getString (String path) {
-        StringBuilder contentBuilder = new StringBuilder();
-        try {
-			BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(URLDecoder.decode(path, "UTF-8")), "UTF-8"));
-
-            String str;
-            while ((str = in.readLine()) != null) {
-                contentBuilder.append(str);
-            };
-            in.close();
-        }
-        catch (IOException e) {
-            fail(e.getMessage());
-        }
-        return contentBuilder.toString();
-    };
-
-
+	// TODO: Probably replace with getJSONQuery
     public static SpanQueryWrapper jsonQuery (String jsonFile) {
         SpanQueryWrapper sqwi;
 
         try {
-            String json = getString(jsonFile);
+            String json = getJsonString(jsonFile);
             sqwi = new KrillQuery("tokens").fromKoral(json);
         }
         catch (QueryException e) {
diff --git a/src/test/java/de/ids_mannheim/korap/search/TestResult.java b/src/test/java/de/ids_mannheim/korap/search/TestResult.java
index 875bf9a..ac4f775 100644
--- a/src/test/java/de/ids_mannheim/korap/search/TestResult.java
+++ b/src/test/java/de/ids_mannheim/korap/search/TestResult.java
@@ -2,7 +2,7 @@
 
 import java.util.*;
 import java.io.*;
-import java.net.URLDecoder;
+import static de.ids_mannheim.korap.TestSimple.*;
 
 import org.apache.lucene.search.spans.SpanQuery;
 
@@ -110,7 +110,7 @@
         ki.addDoc(fd);
         ki.commit();
 
-        String json = getString(getClass()
+        String json = getJsonString(getClass()
                 .getResource("/queries/bugs/optionality_warning.jsonld")
                 .getFile());
         Krill ks = new Krill(json);
@@ -148,7 +148,7 @@
         // Commit!
         ki.commit();
 
-        String json = getString(getClass()
+        String json = getJsonString(getClass()
                 .getResource("/queries/bsp-result-check.jsonld").getFile());
         Krill ks = new Krill(json);
         Result kr = ks.apply(ki);
@@ -260,22 +260,4 @@
         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 InputStreamReader(new FileInputStream(URLDecoder.decode(path, "UTF-8")), "UTF-8"));
-
-            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/server/TestResource.java b/src/test/java/de/ids_mannheim/korap/server/TestResource.java
index 6c0e343..afecf1c 100644
--- a/src/test/java/de/ids_mannheim/korap/server/TestResource.java
+++ b/src/test/java/de/ids_mannheim/korap/server/TestResource.java
@@ -9,6 +9,8 @@
 import javax.ws.rs.client.WebTarget;
 import javax.ws.rs.client.Entity;
 
+import static de.ids_mannheim.korap.TestSimple.*;
+
 import org.glassfish.grizzly.http.server.HttpServer;
 
 import static org.junit.Assert.*;
@@ -17,7 +19,6 @@
 import org.junit.Test;
 
 import java.io.FileInputStream;
-import java.net.URLDecoder;
 
 import de.ids_mannheim.korap.server.Node;
 import de.ids_mannheim.korap.response.Result;
@@ -248,7 +249,7 @@
     public void testCollection () throws IOException {
 
         // mate/l:sein
-        String json = getString(getClass()
+        String json = getJsonString(getClass()
                 .getResource("/queries/bsp-uid-example.jsonld").getFile());
 
         try {
@@ -264,21 +265,4 @@
         };
 
     };
-
-
-    public static String getString (String path) {
-        StringBuilder contentBuilder = new StringBuilder();
-        try {
-			BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(URLDecoder.decode(path, "UTF-8")), "UTF-8"));
-            String str;
-            while ((str = in.readLine()) != null) {
-                contentBuilder.append(str);
-            };
-            in.close();
-        }
-        catch (IOException e) {
-            fail(e.getMessage());
-        };
-        return contentBuilder.toString();
-    };
 };
