diff --git a/src/main/java/de/ids_mannheim/korap/KrillQuery.java b/src/main/java/de/ids_mannheim/korap/KrillQuery.java
index 5a0ccd7..f7fbdbd 100644
--- a/src/main/java/de/ids_mannheim/korap/KrillQuery.java
+++ b/src/main/java/de/ids_mannheim/korap/KrillQuery.java
@@ -88,7 +88,7 @@
     // Variables used for relation queries
     private String direction;
     private byte[] classNumbers;
-    
+
     // Private class for koral:boundary objects
     private class Boundary {
         public int min, max;
@@ -185,6 +185,7 @@
         return this.fromJson(jsonN);
     };
 
+
     /**
      * <p>Deserialize JSON-LD query as a {@link JsonNode} object
      * to a {@link SpanQueryWrapper} object.</p>
@@ -198,7 +199,7 @@
     // TODO: Use the shortcuts implemented in the builder
     //       instead of the wrapper constructors
     // TODO: Rename this span context!
-    public SpanQueryWrapper fromJson(JsonNode json) throws QueryException {
+    public SpanQueryWrapper fromJson (JsonNode json) throws QueryException {
         int number = 0;
 
         // Only accept @typed objects for the moment
@@ -413,7 +414,7 @@
                 if (!json.has("relation")) {
                     throw new QueryException(717, "Missing relation node");
                 }
-                
+
                 return _operationRelationFromJson(operands,
                         json.get("relation"));
                 /*throw new QueryException(765,
@@ -431,9 +432,9 @@
         throw new QueryException(711, "Unknown group operation");
     };
 
-    private SpanQueryWrapper _operationRelationFromJson(JsonNode operands,
-            JsonNode relation)
-            throws QueryException {
+
+    private SpanQueryWrapper _operationRelationFromJson (JsonNode operands,
+            JsonNode relation) throws QueryException {
 
         if (operands.size() < 2) {
             throw new QueryException(705,
@@ -454,6 +455,7 @@
 
     }
 
+
     // Deserialize operation:junction
     private SpanQueryWrapper _operationJunctionFromJson (JsonNode operands)
             throws QueryException {
@@ -916,13 +918,15 @@
         throw new QueryException(745, "Token type is not supported");
     };
 
+
     private SpanQueryWrapper _termFromJson (JsonNode json)
             throws QueryException {
         return _termFromJson(json, null);
     }
 
+
     // Deserialize koral:term
-    private SpanQueryWrapper _termFromJson(JsonNode json, String direction)
+    private SpanQueryWrapper _termFromJson (JsonNode json, String direction)
             throws QueryException {
 
         if (!json.has("key") || json.get("key").asText().length() < 1) {
diff --git a/src/main/java/de/ids_mannheim/korap/query/wrap/SpanRelationWrapper.java b/src/main/java/de/ids_mannheim/korap/query/wrap/SpanRelationWrapper.java
index c4dd49b..634ade8 100644
--- a/src/main/java/de/ids_mannheim/korap/query/wrap/SpanRelationWrapper.java
+++ b/src/main/java/de/ids_mannheim/korap/query/wrap/SpanRelationWrapper.java
@@ -15,9 +15,10 @@
     private SpanQueryWrapper subQuery2;
     private byte[] classNumbers;
 
+
     public SpanRelationWrapper (SpanQueryWrapper relationWrapper,
-            SpanQueryWrapper operand1, SpanQueryWrapper operand2,
-            byte[] classNumbers) {
+                                SpanQueryWrapper operand1,
+                                SpanQueryWrapper operand2, byte[] classNumbers) {
 
         this.relationQuery = relationWrapper;
         if (relationQuery != null) {
@@ -36,15 +37,17 @@
         this.classNumbers = classNumbers;
     }
 
+
     @Override
-    public SpanQuery toQuery() throws QueryException {
+    public SpanQuery toQuery () throws QueryException {
 
         if (this.isNull() || this.isEmpty()) {
             return null;
         }
 
         SpanQuery sq = relationQuery.retrieveNode(this.retrieveNode).toQuery();
-        if (sq == null) return null;
+        if (sq == null)
+            return null;
 
         ArrayList<Byte> classNumbers = new ArrayList<Byte>();
         for (byte c : this.classNumbers) {
@@ -59,8 +62,8 @@
                 // match subquery2
                 subq2 = subQuery2.retrieveNode(this.retrieveNode).toQuery();
                 if (subq2 != null) {
-                    return new SpanFocusQuery(
-                            new SpanSegmentQuery(sq, subq2, true), classNumbers);
+                    return new SpanFocusQuery(new SpanSegmentQuery(sq, subq2,
+                            true), classNumbers);
                 }
             }
         }
@@ -69,29 +72,28 @@
                 // match subquery1
                 subq1 = subQuery1.retrieveNode(this.retrieveNode).toQuery();
                 if (subq1 != null) {
-                    return new SpanFocusQuery(
-                            new SpanSegmentQuery(sq, subq1, true),
-                        classNumbers);
+                    return new SpanFocusQuery(new SpanSegmentQuery(sq, subq1,
+                            true), classNumbers);
                 }
-            }               
+            }
         }
-        else{
+        else {
             // match both
             subq1 = subQuery1.retrieveNode(this.retrieveNode).toQuery();
             if (subq1 != null) {
-                SpanFocusQuery fq = new SpanFocusQuery(new SpanSegmentQuery(sq, subq1,
-                        true), (byte) 2);
+                SpanFocusQuery fq = new SpanFocusQuery(new SpanSegmentQuery(sq,
+                        subq1, true), (byte) 2);
                 fq.setSorted(false);
                 sq = fq;
             }
-            
+
             subq2 = subQuery2.retrieveNode(this.retrieveNode).toQuery();
-            if (subq2 != null){
-                return new SpanFocusQuery(new SpanSegmentQuery(sq, subq2, true),
-                    classNumbers);
+            if (subq2 != null) {
+                return new SpanFocusQuery(
+                        new SpanSegmentQuery(sq, subq2, true), classNumbers);
             }
         }
-        
+
         return new SpanFocusQuery(sq, classNumbers);
     }
 }
diff --git a/src/main/java/de/ids_mannheim/korap/server/Node.java b/src/main/java/de/ids_mannheim/korap/server/Node.java
index b4d0068..3e406f5 100644
--- a/src/main/java/de/ids_mannheim/korap/server/Node.java
+++ b/src/main/java/de/ids_mannheim/korap/server/Node.java
@@ -70,23 +70,25 @@
         // create a resource config that scans for JAX-RS resources and providers
         // in de.ids_mannheim.korap.server package
         final ResourceConfig rc = new ResourceConfig()
-            .packages("de.ids_mannheim.korap.server");
+                .packages("de.ids_mannheim.korap.server");
 
         // create and start a new instance of grizzly http server
         // exposing the Jersey application at BASE_URI
-        return GrizzlyHttpServerFactory.createHttpServer(
-            URI.create(BASE_URI), rc
-        );
+        return GrizzlyHttpServerFactory.createHttpServer(URI.create(BASE_URI),
+                rc);
     };
 
+
     /**
      * Starts Grizzly HTTP server exposing JAX-RS
      * resources defined in this application.
      * Mainly used for testing.
      * 
-     * @param nodeName The name of the node.
-     * @param indexPath The path of the Lucene index.
-     *
+     * @param nodeName
+     *            The name of the node.
+     * @param indexPath
+     *            The path of the Lucene index.
+     * 
      * @return Grizzly {@link HttpServer} server.
      */
     public static HttpServer startServer (String nodeName, String indexPath) {
@@ -111,7 +113,8 @@
     /**
      * Runner method for Krill node.
      * 
-     * @param args No special arguments required.
+     * @param args
+     *            No special arguments required.
      * @throws IOException
      */
     public static void main (String[] args) throws IOException {
@@ -121,20 +124,17 @@
         final HttpServer server = startServer();
 
         // Establish shutdown hook
-        Runtime.getRuntime().addShutdownHook(
-            new Thread(
-                new Runnable() {
+        Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() {
 
-                    @Override
-                    public void run () {
-                        log.info("Stop Server");
-                        server.stop();
-                        if (cpds != null)
-                            cpds.close();
-                    };
+            @Override
+            public void run () {
+                log.info("Stop Server");
+                server.stop();
+                if (cpds != null)
+                    cpds.close();
+            };
 
-                }, "shutdownHook")
-        );
+        }, "shutdownHook"));
 
         // Start server
         try {
@@ -151,7 +151,7 @@
     /**
      * Get the name of the node.
      * The name is unique in the cluster and should be persistent.
-     *
+     * 
      * @return The unique name of the node.
      */
     public static String getName () {
@@ -161,8 +161,8 @@
 
     /**
      * Get the URI (incl. port) the node is listening on.
-     *
-     * @return The URI the node is listening on. 
+     * 
+     * @return The URI the node is listening on.
      */
     public static String getListener () {
         return BASE_URI;
@@ -181,7 +181,7 @@
     /**
      * Get the associated database pool
      * for match collection.
-     *
+     * 
      * @return The CPDS {@link ComboPooledDataSource} object.
      */
     public static ComboPooledDataSource getDBPool () {
@@ -213,7 +213,7 @@
 
     /**
      * Get the associuated {@link KrillIndex}.
-     *
+     * 
      * @return The associated {@link KrillIndex}.
      */
     public static KrillIndex getIndex () {
@@ -285,8 +285,9 @@
         // Load configuration
         URL resUrl = Node.class.getClassLoader().getResource(propFile);
         if (resUrl == null) {
-            log.error("Cannot find {}. Please create it using \"{}.info\" as template.",
-                      propFile, propFile);
+            log.error(
+                    "Cannot find {}. Please create it using \"{}.info\" as template.",
+                    propFile, propFile);
             return null;
         };
 
diff --git a/src/main/java/de/ids_mannheim/korap/server/Resource.java b/src/main/java/de/ids_mannheim/korap/server/Resource.java
index be13ee7..7f9e99b 100644
--- a/src/main/java/de/ids_mannheim/korap/server/Resource.java
+++ b/src/main/java/de/ids_mannheim/korap/server/Resource.java
@@ -66,9 +66,8 @@
     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*");
+    static Pattern p = Pattern.compile("\\s*(?i:false|no|inactive|disabled|"
+            + "off|n|neg(?:ative)?|not|null|undef)\\s*");
 
 
     /**
@@ -464,7 +463,7 @@
         Matcher m = p.matcher(value);
         if (m.matches())
             return true;
-        
+
         return false;
     };
 };
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 7e28e1e..f151843 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestRelationIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestRelationIndex.java
@@ -116,7 +116,7 @@
     }
 
 
-    public static FieldDocument createFieldDoc2() {
+    public static FieldDocument createFieldDoc2 () {
         FieldDocument fd = new FieldDocument();
         fd.addString("ID", "doc-2");
         fd.addTV(
diff --git a/src/test/java/de/ids_mannheim/korap/query/TestSpanRelationQueryJSON.java b/src/test/java/de/ids_mannheim/korap/query/TestSpanRelationQueryJSON.java
index 7de20c6..be2eb5f 100644
--- a/src/test/java/de/ids_mannheim/korap/query/TestSpanRelationQueryJSON.java
+++ b/src/test/java/de/ids_mannheim/korap/query/TestSpanRelationQueryJSON.java
@@ -12,7 +12,7 @@
 public class TestSpanRelationQueryJSON {
 
     @Test
-    public void testMatchRelationSource() throws QueryException {
+    public void testMatchRelationSource () throws QueryException {
         //
         String filepath = getClass().getResource(
                 "/queries/relation/match-source.json").getFile();
@@ -23,8 +23,9 @@
                 sq.toString());
     }
 
+
     @Test
-    public void testMatchRelationTarget() throws QueryException {
+    public void testMatchRelationTarget () throws QueryException {
         //
         String filepath = getClass().getResource(
                 "/queries/relation/match-target.json").getFile();
@@ -35,8 +36,9 @@
                 sq.toString());
     }
 
+
     @Test
-    public void testMatchRelationSourceAndTarget() throws QueryException {
+    public void testMatchRelationSourceAndTarget () throws QueryException {
         //
         String filepath = getClass().getResource(
                 "/queries/relation/match-source-and-target.json").getFile();
@@ -47,8 +49,9 @@
                 sq.toString());
     }
 
+
     @Test
-    public void testMatchOperandWithProperty() throws QueryException {
+    public void testMatchOperandWithProperty () throws QueryException {
         //
         String filepath = getClass().getResource(
                 "/queries/relation/operand-with-property.json").getFile();
@@ -60,8 +63,9 @@
                 sq.toString());
     }
 
+
     @Test
-    public void testMatchOperandWithAttribute() throws QueryException {
+    public void testMatchOperandWithAttribute () throws QueryException {
         //
         String filepath = getClass().getResource(
                 "/queries/relation/operand-with-attribute.json").getFile();
@@ -73,8 +77,9 @@
                 sq.toString());
     }
 
+
     @Test
-    public void testMatchRelationOnly() throws QueryException {
+    public void testMatchRelationOnly () throws QueryException {
         //
         String filepath = getClass().getResource(
                 "/queries/relation/relation-only.json").getFile();
@@ -83,7 +88,8 @@
         assertEquals("focus([1,2]tokens:<:mate/d:HEAD)", sq.toString());
     }
 
-    public void testFocusSource() throws QueryException {
+
+    public void testFocusSource () throws QueryException {
         //
         String filepath = getClass().getResource(
                 "/queries/relation/focus-source.json").getFile();
@@ -94,7 +100,8 @@
                 sq.toString());
     }
 
-    public void testFocusTarget() throws QueryException {
+
+    public void testFocusTarget () throws QueryException {
         String filepath = getClass().getResource(
                 "/queries/relation/match-source.json").getFile();
         SpanQueryWrapper sqwi = getJSONQuery(filepath);
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 4593320..ce44a19 100644
--- a/src/test/java/de/ids_mannheim/korap/server/TestResource.java
+++ b/src/test/java/de/ids_mannheim/korap/server/TestResource.java
@@ -37,6 +37,7 @@
 
     ObjectMapper mapper = new ObjectMapper();
 
+
     @Before
     public void setUp () throws Exception {
         // start the server
@@ -80,6 +81,7 @@
         assertEquals("Gimme 5 minutes, please!", responseMsg);
     };
 
+
     @Test
     public void testInfo () throws IOException {
         String responseMsg = target.path("/").request().get(String.class);
@@ -105,7 +107,7 @@
             try {
                 // Put new documents to the index
                 resp = target.path("/index/" + i).request("application/json")
-                    .put(jsonE, String.class);
+                        .put(jsonE, String.class);
 
                 res = mapper.readTree(resp);
                 assertEquals("milena", res.at("/node").asText());
@@ -129,13 +131,12 @@
     public void testCollection () throws IOException {
 
         String json = getString(getClass().getResource(
-            "/queries/bsp-uid-example.jsonld").getFile()
-        );
+                "/queries/bsp-uid-example.jsonld").getFile());
 
         try {
             String resp = target.path("/").queryParam("uid", "1")
-                .queryParam("uid", "4").request("application/json")
-                .post(Entity.json(json), String.class);
+                    .queryParam("uid", "4").request("application/json")
+                    .post(Entity.json(json), String.class);
             JsonNode res = mapper.readTree(resp);
             assertEquals(2, res.at("/totalResults").asInt());
         }
