diff --git a/.gitignore b/.gitignore
index 38ccf9a..27469c6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -20,4 +20,5 @@
 /src/main/resources/server.properties
 /src/main/resources/krill.properties
 /src/main/resources/korap.conf
+/dependency-reduced-pom.xml
 /bin
diff --git a/pom.xml b/pom.xml
index e0eb994..2c68c10 100644
--- a/pom.xml
+++ b/pom.xml
@@ -7,17 +7,18 @@
       # Start the server with
       $ mvn clean compile exec:java
 
+      # Or after packaging
+      $ mvn clean package
+      # with
+      $ java -jar target/Krill-Server.jar
+
+
       ** Formatter
       # Format the code with
       $ mvn java-formatter:format
 
-      ** Indexer
-         (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
+      ** Indexer after packaging (see above)
+      $ java -jar target/Krill-Indexer.jar
              src/main/resources/krill.properties
              /data/hdd/lucene-new/WPD/
   -->
@@ -237,39 +238,47 @@
 
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-assembly-plugin</artifactId>
-        <version>2.2-beta-5</version>
-        <configuration>	    
-          <archive>
-            <manifest>
-              <addClasspath>true</addClasspath>
-              <mainClass>de.ids_mannheim.korap.index.Indexer</mainClass>
-            </manifest>
-          </archive>
-          <appendAssemblyId>false</appendAssemblyId>
-          <descriptorRefs>
-            <descriptorRef>jar-with-dependencies</descriptorRef>
-          </descriptorRefs>
-        </configuration>
+        <artifactId>maven-shade-plugin</artifactId>
+        <version>2.4.1</version>
         <executions>
           <execution>
-            <id>Indexer</id>
+	    <id>indexer</id>
             <phase>package</phase>
             <goals>
-              <goal>single</goal>
+              <goal>shade</goal>
             </goals>
             <configuration>
-              <finalName>Indexer</finalName>
-              <archive>
-                <manifest>
-		  <mainClass>de.ids_mannheim.korap.index.Indexer</mainClass>
-                </manifest>
-              </archive>
+              <transformers>
+                <transformer
+		    implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
+                  <mainClass>de.ids_mannheim.korap.index.Indexer</mainClass>
+                </transformer>
+              </transformers>
+	      <finalName>${project.artifactId}-Indexer</finalName>
             </configuration>
           </execution>
-	</executions>
+          <execution>
+	    <id>server</id>
+            <phase>package</phase>
+            <goals>
+              <goal>shade</goal>
+            </goals>
+            <configuration>
+              <transformers>
+                <transformer
+		    implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
+                  <mainClass>de.ids_mannheim.korap.server.Node</mainClass>
+                </transformer>
+                <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
+                  <resource>krill.properties</resource>
+                </transformer>
+              </transformers>
+	      <finalName>${project.name}-Server</finalName>
+            </configuration>
+          </execution>
+        </executions>
       </plugin>
- 
+
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-surefire-plugin</artifactId>
diff --git a/src/main/java/de/ids_mannheim/korap/KrillIndex.java b/src/main/java/de/ids_mannheim/korap/KrillIndex.java
index ef34cfd..8a052b0 100644
--- a/src/main/java/de/ids_mannheim/korap/KrillIndex.java
+++ b/src/main/java/de/ids_mannheim/korap/KrillIndex.java
@@ -6,6 +6,7 @@
 import de.ids_mannheim.korap.response.*;
 import de.ids_mannheim.korap.query.SpanElementQuery;
 import de.ids_mannheim.korap.util.QueryException;
+import static de.ids_mannheim.korap.util.KrillProperties.*;
 
 // Lucene classes
 import org.apache.lucene.search.*;
@@ -120,7 +121,7 @@
     private int maxTermRelations = 100;
     private int autoCommit = 500;
     private String version = "unknown";
-    private String name = "Krill";
+    private String name = "Unknown";
 
     // Temp:
     private IndexReader reader;
@@ -144,47 +145,30 @@
             bbTerm = ByteBuffer.allocate(16);
 
     // Some initializations ...
-    // TODO: This should probably happen at a more central point
     {
-        Properties prop = new Properties();
-        URL file = getClass().getClassLoader().getResource("krill.properties");
+        Properties prop = loadProperties();
+        this.version = prop.getProperty("krill.version");
+        this.name = prop.getProperty("krill.name");
 
-        // File found
-        if (file != null) {
-            String f = file.getFile();
-            // Read property file
+        // Check for auto commit value
+        String stringProp = prop.getProperty("krill.index.commit.auto");
+        if (stringProp != null) {
             try {
-                InputStream fr = new FileInputStream(f);
-                prop.load(fr);
-                this.version = prop.getProperty("krill.version");
-                this.name = prop.getProperty("krill.name");
-
-                // Check for auto commit value
-                String stringProp = prop.getProperty("krill.index.commit.auto");
-                if (stringProp != null) {
-                    try {
-                        this.autoCommit = Integer.parseInt(stringProp);
-                    }
-                    catch (NumberFormatException e) {
-                        log.error("krill.index.commit.auto expected to be a numerical value");
-                    };
-                };
-
-                // Check for maximum term relations
-                stringProp = prop.getProperty("krill.index.relations.max");
-                if (stringProp != null) {
-                    try {
-                        this.maxTermRelations = Integer.parseInt(stringProp);
-                    }
-                    catch (NumberFormatException e) {
-                        log.error("krill.index.commit.auto expected to be a numerical value");
-                    };
-                };
+                this.autoCommit = Integer.parseInt(stringProp);
             }
+            catch (NumberFormatException e) {
+                log.error("krill.index.commit.auto expected to be a numerical value");
+            };
+        };
 
-            // Unable to read property file
-            catch (FileNotFoundException e) {
-                log.warn(e.getLocalizedMessage());
+        // Check for maximum term relations
+        stringProp = prop.getProperty("krill.index.relations.max");
+        if (stringProp != null) {
+            try {
+                this.maxTermRelations = Integer.parseInt(stringProp);
+            }
+            catch (NumberFormatException e) {
+                log.error("krill.index.commit.auto expected to be a numerical value");
             };
         };
     };
@@ -1288,11 +1272,12 @@
                  * by using OpenBitSet - but this may not be as fast as I think.
                  */
                 final Bits bitset = collection.bits(atomic);
-                final PositionsToOffset pto = new PositionsToOffset(atomic, field);
+                final PositionsToOffset pto = new PositionsToOffset(atomic,
+                        field);
 
                 // Spans spans = NearSpansOrdered();
                 final Spans spans = query.getSpans(atomic, (Bits) bitset,
-                                                   termContexts);
+                        termContexts);
 
                 final IndexReader lreader = atomic.reader();
                 int localDocID, docID;
@@ -1349,8 +1334,8 @@
                             localDocID, fields) : lreader.document(localDocID);
 
                     // Create new Match
-                    final Match match = new Match(pto, localDocID, spans.start(),
-                            spans.end());
+                    final Match match = new Match(pto, localDocID,
+                            spans.start(), spans.end());
                     match.setContext(kr.getContext());
 
                     // Add match to Result
diff --git a/src/main/java/de/ids_mannheim/korap/query/SimpleSpanQuery.java b/src/main/java/de/ids_mannheim/korap/query/SimpleSpanQuery.java
index 0510437..7e428a4 100644
--- a/src/main/java/de/ids_mannheim/korap/query/SimpleSpanQuery.java
+++ b/src/main/java/de/ids_mannheim/korap/query/SimpleSpanQuery.java
@@ -339,7 +339,8 @@
             throws IOException {
 
         for (int i = 0; i < spanQueries.size(); i++) {
-            final SpanQuery query = (SpanQuery) spanQueries.get(i).rewrite(reader);
+            final SpanQuery query = (SpanQuery) spanQueries.get(i).rewrite(
+                    reader);
             if (!query.equals(spanQueries.get(i))) {
                 if (clone == null)
                     clone = clone();
diff --git a/src/main/java/de/ids_mannheim/korap/query/spans/ElementSpans.java b/src/main/java/de/ids_mannheim/korap/query/spans/ElementSpans.java
index 30515d5..0e4768d 100644
--- a/src/main/java/de/ids_mannheim/korap/query/spans/ElementSpans.java
+++ b/src/main/java/de/ids_mannheim/korap/query/spans/ElementSpans.java
@@ -34,9 +34,10 @@
     private final Logger log = LoggerFactory.getLogger(ElementSpans.class);
     // This advices the java compiler to ignore all loggings
     public static final boolean DEBUG = false;
-    
+
     private byte[] b = new byte[8];
 
+
     /**
      * Constructs ElementSpans for the given {@link SpanElementQuery}.
      * 
diff --git a/src/main/java/de/ids_mannheim/korap/response/Response.java b/src/main/java/de/ids_mannheim/korap/response/Response.java
index d5846fb..a1f72a4 100644
--- a/src/main/java/de/ids_mannheim/korap/response/Response.java
+++ b/src/main/java/de/ids_mannheim/korap/response/Response.java
@@ -49,8 +49,8 @@
     private String benchmark;
     private boolean timeExceeded = false;
 
-    private static final String KORAL_VERSION =
-        "http://korap.ids-mannheim.de/ns/KoralQuery/v0.3/context.jsonld";
+    private static final String KORAL_VERSION = "http://korap.ids-mannheim.de/ns/KoralQuery/v0.3/context.jsonld";
+
 
     /**
      * Construct a new Response object.
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 3e406f5..78d46db 100644
--- a/src/main/java/de/ids_mannheim/korap/server/Node.java
+++ b/src/main/java/de/ids_mannheim/korap/server/Node.java
@@ -19,6 +19,8 @@
 import de.ids_mannheim.korap.KrillIndex;
 import org.apache.lucene.store.MMapDirectory;
 
+import static de.ids_mannheim.korap.util.KrillProperties.*;
+
 import com.mchange.v2.c3p0.*;
 
 /**
@@ -65,7 +67,18 @@
      * @return Grizzly HTTP server.
      */
     public static HttpServer startServer () {
-        _loadResourceProperties();
+        Properties prop = loadProperties(propFile);
+
+        // Node properties
+        path = prop.getProperty("krill.indexDir", path);
+        name = prop.getProperty("krill.server.name", name);
+        BASE_URI = prop.getProperty("krill.server.baseURI", BASE_URI);
+
+        // Database properties
+        dbUser = prop.getProperty("krill.db.user", dbUser);
+        dbPwd = prop.getProperty("krill.db.pwd", dbPwd);
+        dbClass = prop.getProperty("krill.db.class", dbClass);
+        dbURL = prop.getProperty("krill.db.jdbcURL", dbURL);
 
         // create a resource config that scans for JAX-RS resources and providers
         // in de.ids_mannheim.korap.server package
@@ -251,46 +264,4 @@
         };
         return null;
     };
-
-
-    // Load properties from file
-    private static Properties _loadProperties (String propFile) {
-        try {
-            InputStream file = new FileInputStream(propFile);
-            Properties prop = new Properties();
-            prop.load(file);
-
-            // Node properties
-            path = prop.getProperty("krill.indexDir", path);
-            name = prop.getProperty("krill.server.name", name);
-            BASE_URI = prop.getProperty("krill.server.baseURI", BASE_URI);
-
-            // Database properties
-            dbUser = prop.getProperty("krill.db.user", dbUser);
-            dbPwd = prop.getProperty("krill.db.pwd", dbPwd);
-            dbClass = prop.getProperty("krill.db.class", dbClass);
-            dbURL = prop.getProperty("krill.db.jdbcURL", dbURL);
-            return prop;
-        }
-        catch (IOException e) {
-            log.error(e.getLocalizedMessage());
-        };
-        return null;
-    };
-
-
-    // Load properties from resource file
-    private static Properties _loadResourceProperties () {
-
-        // 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);
-            return null;
-        };
-
-        return _loadProperties(resUrl.getFile());
-    };
 };
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 52bfa11..83f69b5 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,9 @@
     public final static boolean DEBUG = false;
 
     // Slightly based on String::BooleanSimple
-    private final static Pattern p =
-        Pattern.compile("\\s*(?i:false|no|inactive|disabled|"
-            + "off|n|neg(?:ative)?|not|null|undef)\\s*");
+    private final static Pattern p = Pattern
+            .compile("\\s*(?i:false|no|inactive|disabled|"
+                    + "off|n|neg(?:ative)?|not|null|undef)\\s*");
 
     private KrillIndex index;
 
@@ -133,11 +133,8 @@
         };
 
         // Set HTTP to 200
-        kresp.addMessage(
-            681,
-            "Document was added successfully",
-            fd.getID() != null ? fd.getID() : "Unknown"
-        );
+        kresp.addMessage(681, "Document was added successfully",
+                fd.getID() != null ? fd.getID() : "Unknown");
 
         return kresp.toJsonString();
     };
@@ -195,9 +192,8 @@
         final MultivaluedMap<String, String> qp = uri.getQueryParameters();
 
         if (qp.get("uid") == null) {
-            kresp.addError(610,
-                           "Missing request parameters",
-                           "No unique IDs were given");
+            kresp.addError(610, "Missing request parameters",
+                    "No unique IDs were given");
             return kresp.toJsonString();
         };
 
@@ -237,7 +233,8 @@
 
         // Get the database
         try {
-            final MatchCollectorDB mc = new MatchCollectorDB(1000, "Res_" + resultID);
+            final MatchCollectorDB mc = new MatchCollectorDB(1000, "Res_"
+                    + resultID);
             final ComboPooledDataSource pool = Node.getDBPool();
             mc.setDBPool("mysql", pool, pool.getConnection());
 
@@ -331,9 +328,9 @@
 
         try {
             // Get match info
-            return index.getMatchInfo(id, "tokens", info, foundries,
-                                      layers, includeSpans, includeHighlights,
-                                      extendToSentence).toJsonString();
+            return index.getMatchInfo(id, "tokens", info, foundries, layers,
+                    includeSpans, includeHighlights, extendToSentence)
+                    .toJsonString();
         }
 
         // Nothing found
@@ -417,6 +414,7 @@
         return kresp;
     };
 
+
     // Check if a string is meant to represent null
     private static boolean _isNull (String value) {
         if (value == null)
diff --git a/src/main/java/de/ids_mannheim/korap/util/KrillProperties.java b/src/main/java/de/ids_mannheim/korap/util/KrillProperties.java
new file mode 100644
index 0000000..551fc0c
--- /dev/null
+++ b/src/main/java/de/ids_mannheim/korap/util/KrillProperties.java
@@ -0,0 +1,53 @@
+package de.ids_mannheim.korap.util;
+
+import java.util.*;
+import java.io.*;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import de.ids_mannheim.korap.Krill;
+
+// Todo: Properties may be loaded twice - althogh Java may cache automatically
+public class KrillProperties {
+
+    // Logger
+    private final static Logger log = LoggerFactory.getLogger(Krill.class);
+
+
+    // Load properties from file
+    public static Properties loadProperties () {
+        return loadProperties("krill.properties");
+    };
+
+
+    // Load properties from file
+    public static Properties loadProperties (String propFile) {
+        InputStream file;
+        Properties prop;
+        try {
+            file = new FileInputStream(propFile);
+            prop = new Properties();
+            prop.load(file);
+        }
+        catch (IOException t) {
+            try {
+                file = KrillProperties.class.getClassLoader()
+                        .getResourceAsStream(propFile);
+
+                if (file == null) {
+                    log.error(
+                            "Cannot find {}. Please create it using \"{}.info\" as template.",
+                            propFile, propFile);
+                    return null;
+                };
+
+                prop = new Properties();
+                prop.load(file);
+            }
+            catch (IOException e) {
+                log.error(e.getLocalizedMessage());
+                return null;
+            };
+        };
+        return prop;
+    };
+};
diff --git a/src/test/java/de/ids_mannheim/korap/benchmark/TestBenchmarkSamples.java b/src/test/java/de/ids_mannheim/korap/benchmark/TestBenchmarkSamples.java
index 69e8503..535b1ce 100644
--- a/src/test/java/de/ids_mannheim/korap/benchmark/TestBenchmarkSamples.java
+++ b/src/test/java/de/ids_mannheim/korap/benchmark/TestBenchmarkSamples.java
@@ -28,6 +28,7 @@
     private final int rounds = 1000;
     private long t1 = 0, t2 = 0;
 
+
     @Test
     public void simpleSegmentQuery () throws Exception {
         // Construct index
@@ -36,10 +37,10 @@
 
         // Indexing test files
         for (String i : new String[] { "00001", "00002", "00003", "00004",
-                                           "00005", "00006", "02439" }) {
+                "00005", "00006", "02439" }) {
             ki.addDoc(
-                      getClass().getResourceAsStream("/wiki/" + i + ".json.gz"),
-                      true);
+                    getClass().getResourceAsStream("/wiki/" + i + ".json.gz"),
+                    true);
         };
         ki.commit();
 
diff --git a/src/test/java/de/ids_mannheim/korap/collection/TestKrillCollectionJSON.java b/src/test/java/de/ids_mannheim/korap/collection/TestKrillCollectionJSON.java
index 6c2b2f9..e8fa3f8 100644
--- a/src/test/java/de/ids_mannheim/korap/collection/TestKrillCollectionJSON.java
+++ b/src/test/java/de/ids_mannheim/korap/collection/TestKrillCollectionJSON.java
@@ -104,6 +104,7 @@
         assertEquals("-author:goethe", ks.getCollection().toString());
     };
 
+
     @Test
     public void nocollectiontypegiven () {
         String metaQuery = _getJSONString("multiterm_rewrite_collection.jsonld");
@@ -157,7 +158,6 @@
 
 
 
-
     // Legacy collections reflect old tests, that were adopted to the new scheme
     @Test
     public void metaQuery1Legacy () {
diff --git a/src/test/java/de/ids_mannheim/korap/response/TestResponse.java b/src/test/java/de/ids_mannheim/korap/response/TestResponse.java
index 99bc0a5..1ab89fe 100644
--- a/src/test/java/de/ids_mannheim/korap/response/TestResponse.java
+++ b/src/test/java/de/ids_mannheim/korap/response/TestResponse.java
@@ -25,8 +25,9 @@
     public void testResponse () throws IOException {
         Response resp = new Response();
         JsonNode respJson = mapper.readTree(resp.toJsonString());
-        assertEquals("http://korap.ids-mannheim.de/ns/KoralQuery/v0.3/context.jsonld",
-                     respJson.at("/@context").asText());
+        assertEquals(
+                "http://korap.ids-mannheim.de/ns/KoralQuery/v0.3/context.jsonld",
+                respJson.at("/@context").asText());
         assertEquals("", respJson.at("/meta").asText());
 
         resp.setVersion("0.24");
@@ -59,8 +60,9 @@
     public void testResponseNotifications () throws IOException {
         Response resp = new Response();
         JsonNode respJson = mapper.readTree(resp.toJsonString());
-        assertEquals("http://korap.ids-mannheim.de/ns/KoralQuery/v0.3/context.jsonld",
-                     respJson.at("/@context").asText());
+        assertEquals(
+                "http://korap.ids-mannheim.de/ns/KoralQuery/v0.3/context.jsonld",
+                respJson.at("/@context").asText());
         assertEquals("", respJson.at("/meta").asText());
         resp.setVersion("0.24");
         resp.setNode("Tanja");
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 4d4dd48..79de7d3 100644
--- a/src/test/java/de/ids_mannheim/korap/server/TestResource.java
+++ b/src/test/java/de/ids_mannheim/korap/server/TestResource.java
@@ -75,8 +75,8 @@
         Node.closeDBPool();
         t4 = System.nanoTime();
 
-        double startup  = (double) (t2 - t1) / 1000000000.0;
-        double action   = (double) (t3 - t2) / 1000000000.0;
+        double startup = (double) (t2 - t1) / 1000000000.0;
+        double action = (double) (t3 - t2) / 1000000000.0;
         double shutdown = (double) (t4 - t3) / 1000000000.0;
 
         /*
@@ -107,13 +107,13 @@
         assertEquals(680, res.at("/messages/0/0").asInt());
     };
 
+
     @Test
     public void testIndexing () throws IOException {
         String resp;
         JsonNode res;
 
-        for (String i : new String[] {
-                "00001", "00002", "00003", "00004",
+        for (String i : new String[] { "00001", "00002", "00003", "00004",
                 "00005", "00006", "02439" }) {
 
             String json = StringfromFile(getClass().getResource(
