diff --git a/Changes b/Changes
index 42755eb..8a293e9 100644
--- a/Changes
+++ b/Changes
@@ -1,8 +1,9 @@
-0.58.3 2018-12-12
+0.58.3 2018-12-17
     - [feature] Introduced attachements as meta data fields
       (fixes #49) (diewald).
     - [feature] Introduced preliminary support of arbitrary
       metadata fields (see #47) (diewald)
+    - [performance] Added debug flags (margaretha)  
 
 0.58.2 2018-12-05
     - [bugfix] Fixed the candidate list in NextSpans, see de.ids_mannheim.
diff --git a/src/main/java/de/ids_mannheim/korap/collection/CachedVCFilter.java b/src/main/java/de/ids_mannheim/korap/collection/CachedVCFilter.java
index 5b1bff7..de851c1 100644
--- a/src/main/java/de/ids_mannheim/korap/collection/CachedVCFilter.java
+++ b/src/main/java/de/ids_mannheim/korap/collection/CachedVCFilter.java
@@ -17,6 +17,8 @@
  */
 public class CachedVCFilter extends Filter {
 
+    public static final boolean DEBUG = false;
+
     public static Logger jlog = LogManager.getLogger(CachedVCFilter.class);
 
     private CachedVCData cachedCollection;
@@ -34,7 +36,8 @@
                 cachedCollection.getDocIdMap().get(context.hashCode());
 
         if (docBits == null) {
-            jlog.debug("LeafReaderContext is not found in the cache.");
+            if (DEBUG)
+                jlog.debug("LeafReaderContext is not found in the cache.");
             return null;
         }
         return docBits.createBitDocIdSet();
diff --git a/src/main/java/de/ids_mannheim/korap/collection/CollectionBuilder.java b/src/main/java/de/ids_mannheim/korap/collection/CollectionBuilder.java
index 10f4645..07a1598 100644
--- a/src/main/java/de/ids_mannheim/korap/collection/CollectionBuilder.java
+++ b/src/main/java/de/ids_mannheim/korap/collection/CollectionBuilder.java
@@ -289,7 +289,9 @@
 			Element element = KrillCollection.cache.get(this.reference);
 			
             if (element == null) {
-                log.debug(reference + " is NOT found in the cache");
+                if (DEBUG) {
+                    log.debug(reference + " is NOT found in the cache");
+                }
                 KrillCollection kc = new KrillCollection();
 
 				kc.fromStore(this.reference);
@@ -309,7 +311,9 @@
 					);
 			}
             else {
-                log.debug(reference + " is FOUND in the cache.");
+                if (DEBUG) { 
+                    log.debug(reference + " is FOUND in the cache."); 
+                }
                 CachedVCData cc = (CachedVCData) element.getObjectValue();
                 return new CachedVCFilter(this.reference, cc);
             }
diff --git a/src/main/java/de/ids_mannheim/korap/collection/ToCacheVCFilter.java b/src/main/java/de/ids_mannheim/korap/collection/ToCacheVCFilter.java
index 3a3675d..4e638ee 100644
--- a/src/main/java/de/ids_mannheim/korap/collection/ToCacheVCFilter.java
+++ b/src/main/java/de/ids_mannheim/korap/collection/ToCacheVCFilter.java
@@ -32,6 +32,7 @@
     private boolean isAutoCachingEnabled = false;
 
     public final static Logger log = LoggerFactory.getLogger(ToCacheVCFilter.class);
+    public static final boolean DEBUG = false;
             
     public ToCacheVCFilter (String cacheKey, Map<Integer, DocBits> docIdMap,
                             Interface cbi, Filter filter) {
@@ -76,7 +77,9 @@
             KrillCollection.cache.put(new Element(cacheKey, cachedVCData));
         }
 
-        log.debug("To cache doc bits length: "+ docIdSet.bits().length());
+        if (DEBUG){
+            log.debug("To cache doc bits length: "+ docIdSet.bits().length());
+        }
         return docIdSet;
     }
 
diff --git a/src/main/java/de/ids_mannheim/korap/index/Indexer.java b/src/main/java/de/ids_mannheim/korap/index/Indexer.java
index d17215f..0967860 100644
--- a/src/main/java/de/ids_mannheim/korap/index/Indexer.java
+++ b/src/main/java/de/ids_mannheim/korap/index/Indexer.java
@@ -1,9 +1,13 @@
 package de.ids_mannheim.korap.index;
 
-import java.util.*;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.nio.file.Paths;
+import java.util.Properties;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
-import java.io.*;
 
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.CommandLineParser;
@@ -15,13 +19,11 @@
 import org.apache.commons.cli.ParseException;
 import org.apache.commons.lang.StringUtils;
 import org.apache.lucene.store.MMapDirectory;
-import de.ids_mannheim.korap.KrillIndex;
-import de.ids_mannheim.korap.util.KrillProperties;
-
-import static de.ids_mannheim.korap.util.KrillProperties.*;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import java.nio.file.Paths;
+
+import de.ids_mannheim.korap.KrillIndex;
+import de.ids_mannheim.korap.util.KrillProperties;
 
 /**
  * Standalone indexer tool for Krill.
@@ -59,6 +61,7 @@
 
     // Init logger
     private final static Logger log = LoggerFactory.getLogger(Indexer.class);
+    private static final boolean DEBUG = false;
 
     /**
      * Construct a new indexer object.
@@ -109,7 +112,9 @@
                         continue;
                     }
                     this.count++;
-                    log.debug("Finished adding files. (" + count + ").");
+                    if (DEBUG){
+                        log.debug("Finished adding files. (" + count + ").");
+                    }
 
                     // Commit in case the commit count is reached
                     if ((this.count % this.commitCount) == 0)
diff --git a/src/main/java/de/ids_mannheim/korap/query/spans/FocusSpans.java b/src/main/java/de/ids_mannheim/korap/query/spans/FocusSpans.java
index 3e5fab0..b341c77 100644
--- a/src/main/java/de/ids_mannheim/korap/query/spans/FocusSpans.java
+++ b/src/main/java/de/ids_mannheim/korap/query/spans/FocusSpans.java
@@ -17,7 +17,6 @@
 import de.ids_mannheim.korap.constants.RelationDirection;
 import de.ids_mannheim.korap.query.SpanFocusQuery;
 
-
 /**
  * originalSpans, that can focus on the span boundaries of classed
  * subqueries.
@@ -58,7 +57,6 @@
     private PriorityQueue<CandidateSpan> candidates;
     private CandidateSpanComparator comparator;
 
-
     /**
      * Construct a FocusSpan for the given {@link SpanQuery}.
      * 
@@ -96,7 +94,6 @@
         this.query = query;
     }
 
-
     @Override
     public boolean next () throws IOException {
         matchPayload.clear();
@@ -127,24 +124,25 @@
         return false;
     }
 
-
     private void collectCandidates () throws IOException {
         CandidateSpan cs = null;
         CandidateSpan head = null;
-        
+
         while (hasMoreSpans && firstSpans.doc() == currentDoc) {
-            if (head == null){ 
+            if (head == null) {
                 head = candidates.peek();
             }
-            else if (head.getStart() < firstSpans.start()){
+            else if (head.getStart() < firstSpans.start()) {
                 break;
             }
-            
+
             if (firstSpans.isPayloadAvailable() && updateSpanPositions(
                     cs = new CandidateSpan(firstSpans))) {
                 if (cs.getDoc() == prevDoc && cs.getStart() < prevStart) {
-                    log.warn("Span (" + cs.getStart() + ", " + cs.getEnd()
-                            + ") is out of order and skipped.");
+                    if (DEBUG) {
+                        log.debug("Span (" + cs.getStart() + ", " + cs.getEnd()
+                                + ") is out of order and skipped.");
+                    }
                 }
                 else {
                     candidates.add(cs);
@@ -154,7 +152,6 @@
         }
     }
 
-
     private void setMatch (CandidateSpan cs) {
         matchStartPosition = cs.getStart();
         prevStart = matchStartPosition;
@@ -187,8 +184,9 @@
             // throw new
             // IllegalArgumentException("Classnumber is not found.");
             // }
-            if (spanId > 0)
+            if (spanId > 0) {
                 hasSpanId = true;
+            }
         }
         else if (cs.getSpanId() > 0) {
             setSpanId(cs.getSpanId());
@@ -197,7 +195,6 @@
 
     }
 
-
     private boolean updateSpanPositions (CandidateSpan candidateSpan)
             throws IOException {
         int minPos = 0, maxPos = 0;
@@ -207,7 +204,8 @@
 
         candidateSpan.getPayloads().clear();
 
-        // Iterate over all payloads and find the maximum span per class
+        // Iterate over all payloads and find the maximum span per
+        // class
         for (byte[] payload : firstSpans.getPayload()) {
             // No class payload - ignore
             // this may be problematic for other calculated payloads!
@@ -241,7 +239,7 @@
                 continue;
             };
 
-            if (//payload.length == 8 || 
+            if (// payload.length == 8 ||
             (removeTemporaryClasses && payload.length == 11)) {
                 continue;
             }
@@ -257,7 +255,6 @@
         return isClassFound;
     }
 
-
     // Todo: Check for this on document boundaries!
     @Override
     public boolean skipTo (int target) throws IOException {
@@ -278,14 +275,12 @@
         return false;
     };
 
-
     @Override
     public String toString () {
         return getClass().getName() + "(" + this.query.toString() + ")@"
                 + (doc() + ":" + start() + "-" + end());
     };
 
-
     @Override
     public long cost () {
         return firstSpans.cost();
diff --git a/src/main/java/de/ids_mannheim/korap/query/spans/RelationSpans.java b/src/main/java/de/ids_mannheim/korap/query/spans/RelationSpans.java
index b9926fd..8f9a807 100644
--- a/src/main/java/de/ids_mannheim/korap/query/spans/RelationSpans.java
+++ b/src/main/java/de/ids_mannheim/korap/query/spans/RelationSpans.java
@@ -52,6 +52,7 @@
  */
 public class RelationSpans extends RelationBaseSpans {
 
+    private static final boolean DEBUG = false;
     private int currentDoc, currentPosition;
     private RelationDirection direction;
     private Spans relationTermSpan;
@@ -158,7 +159,9 @@
      * @throws IOException
      */
     private void setCandidateList () throws IOException {
-        logger.debug("hasMoreSpans "+hasMoreSpans+" "+relationTermSpan.doc());
+        if (DEBUG){
+            logger.debug("hasMoreSpans "+hasMoreSpans+" "+relationTermSpan.doc());
+        }
         while (hasMoreSpans && relationTermSpan.doc() == currentDoc
                 && relationTermSpan.start() == currentPosition) {
 
diff --git a/src/main/java/de/ids_mannheim/korap/query/spans/SubSpans.java b/src/main/java/de/ids_mannheim/korap/query/spans/SubSpans.java
index 4989957..92048e8 100644
--- a/src/main/java/de/ids_mannheim/korap/query/spans/SubSpans.java
+++ b/src/main/java/de/ids_mannheim/korap/query/spans/SubSpans.java
@@ -43,7 +43,6 @@
     private PriorityQueue<CandidateSpan> candidates;
     private CandidateSpanComparator comparator;
 
-
     /**
      * Constructs SubSpans for the given {@link SpanSubspanQuery}
      * specifiying the start offset and the length of the subspans.
@@ -72,14 +71,12 @@
         hasMoreSpans = firstSpans.next();
     }
 
-
     @Override
     public boolean next () throws IOException {
         isStartEnumeration = false;
         return advance();
     }
 
-
     /**
      * Advances the SubSpans to the next match.
      * 
@@ -111,7 +108,6 @@
         return false;
     }
 
-
     private void collectCandidates () throws IOException {
 
         while (hasMoreSpans && candidates.size() < windowSize
@@ -119,8 +115,11 @@
             CandidateSpan cs;
             if (findMatch(cs = new CandidateSpan(firstSpans))) {
                 if (cs.getDoc() == prevDoc && cs.getStart() < prevStart) {
-                    log.warn("Span (" + cs.getStart() + ", " + cs.getEnd()
-                            + ") is out of order and skipped.");
+                    if (DEBUG) {
+                        log.debug("Span (" + cs.getStart() + ", " + cs.getEnd()
+                                + ") is out of order and skipped.");
+                    }
+
                 }
                 else {
                     candidates.add(cs);
@@ -130,7 +129,6 @@
         }
     }
 
-
     /**
      * Sets the properties of the current match/subspan.
      * 
@@ -187,7 +185,6 @@
         return true;
     }
 
-
     private void setMatch (CandidateSpan cs) {
         matchStartPosition = cs.getStart();
         prevStart = matchStartPosition;
@@ -198,7 +195,6 @@
         matchPayload.addAll(cs.getPayloads());
     }
 
-
     @Override
     public boolean skipTo (int target) throws IOException {
         if (candidates.size() > 0) {
@@ -218,7 +214,6 @@
         return advance();
     }
 
-
     @Override
     public long cost () {
         return firstSpans.cost() + 1;
