diff --git a/pom.xml b/pom.xml
index fe15f96..d838e0f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -77,11 +77,6 @@
 			<artifactId>cql-java</artifactId>
 			<version>1.12</version>
 		</dependency>
-		<dependency>
-			<groupId>KorAP-modules</groupId>
-			<artifactId>KorAP-Entities</artifactId>
-			<version>1.1</version>
-		</dependency>
 	</dependencies>
 	<build>
 		<sourceDirectory>${basedir}/src/main/java</sourceDirectory>
diff --git a/src/main/java/de/ids_mannheim/korap/query/serialize/QuerySerializer.java b/src/main/java/de/ids_mannheim/korap/query/serialize/QuerySerializer.java
index b063f73..d62b622 100644
--- a/src/main/java/de/ids_mannheim/korap/query/serialize/QuerySerializer.java
+++ b/src/main/java/de/ids_mannheim/korap/query/serialize/QuerySerializer.java
@@ -1,22 +1,16 @@
 package de.ids_mannheim.korap.query.serialize;
 
 import com.fasterxml.jackson.core.JsonGenerationException;
+import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.JsonMappingException;
-
+import com.fasterxml.jackson.databind.ObjectMapper;
 import de.ids_mannheim.korap.query.serialize.util.KoralObjectGenerator;
 import de.ids_mannheim.korap.query.serialize.util.StatusCodes;
-import de.ids_mannheim.korap.utils.JsonUtils;
-import de.ids_mannheim.korap.utils.KorAPLogger;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 /**
  * @author bingel, hanl
@@ -26,15 +20,16 @@
     static HashMap<String, Class<? extends AbstractQueryProcessor>> qlProcessorAssignment;
 
     static {
-        qlProcessorAssignment = 
-                new HashMap<String, Class<? extends AbstractQueryProcessor>>();
-        qlProcessorAssignment.put("poliqarpplus", PoliqarpPlusQueryProcessor.class);
+        qlProcessorAssignment = new HashMap<String, Class<? extends AbstractQueryProcessor>>();
+        qlProcessorAssignment
+                .put("poliqarpplus", PoliqarpPlusQueryProcessor.class);
         qlProcessorAssignment.put("cosmas2", Cosmas2QueryProcessor.class);
         qlProcessorAssignment.put("annis", AnnisQueryProcessor.class);
         qlProcessorAssignment.put("cql", CqlQueryProcessor.class);
     }
 
-    private Logger qllogger = KorAPLogger.initiate("ql");
+    private static ObjectMapper mapper = new ObjectMapper();
+    private Logger qllogger = LoggerFactory.getLogger("ql");
     public static String queryLanguageVersion;
 
     private AbstractQueryProcessor ast;
@@ -48,7 +43,6 @@
 
     /**
      * @param args
-     * @throws QueryException
      */
     public static void main(String[] args) {
         /*
@@ -60,7 +54,7 @@
         if (args.length == 0) {
             queries = new String[] {
                     "tok=\"corpus\" & tok=\"query\" & tok=\"language\"& #2 . #3 & #1 . #2 "
-                    
+
             };
         }
         else
@@ -97,18 +91,13 @@
      * language) and transforms and writes the tree's requestMap to
      * the specified output file.
      *
-     * @param outFile
-     *            The file to which the serialization is written
-     * @param query
-     *            The query string
-     * @param queryLanguage
-     *            The query language. As of 17 Dec 2014, this must be
-     *            one of 'poliqarpplus', 'cosmas2', 'annis' or 'cql'.
+     * @param outFile       The file to which the serialization is written
+     * @param query         The query string
+     * @param queryLanguage The query language. As of 17 Dec 2014, this must be
+     *                      one of 'poliqarpplus', 'cosmas2', 'annis' or 'cql'.
      * @throws IOException
-     * @throws QueryException
      */
-    public void run(String query, String queryLanguage)
-            throws IOException {
+    public void run(String query, String queryLanguage) throws IOException {
         if (queryLanguage.equalsIgnoreCase("poliqarp")) {
             ast = new PoliqarpPlusQueryProcessor(query);
         }
@@ -125,8 +114,8 @@
             ast = new AnnisQueryProcessor(query);
         }
         else {
-            throw new IllegalArgumentException(queryLanguage
-                    + " is not a supported query language!");
+            throw new IllegalArgumentException(
+                    queryLanguage + " is not a supported query language!");
         }
         toJSON();
     }
@@ -159,8 +148,8 @@
             ast = new AnnisQueryProcessor(query);
         }
         else {
-            ast.addError(StatusCodes.UNKNOWN_QL, ql
-                    + " is not a supported query language!");
+            ast.addError(StatusCodes.UNKNOWN_QL,
+                    ql + " is not a supported query language!");
         }
         return this;
     }
@@ -172,10 +161,16 @@
     public void setVerbose(boolean verbose) {
         AbstractQueryProcessor.verbose = verbose;
     }
-    
+
     public final String toJSON() {
-        String ser = JsonUtils.toJSON(raw());
-        qllogger.info("Serialized query: " + ser);
+        String ser;
+        try {
+            ser = mapper.writeValueAsString(raw());
+            qllogger.info("Serialized query: " + ser);
+        }
+        catch (JsonProcessingException e) {
+            return "";
+        }
         return ser;
     }
 
@@ -215,20 +210,25 @@
         return new HashMap<>();
     }
 
-    private Map<String, Object> mergeCollection(Map<String, Object> collection1, Map<String, Object> collection2) {
-        LinkedHashMap<String, Object> docGroup = KoralObjectGenerator.makeDocGroup("and");
-        ArrayList<Object> operands = (ArrayList<Object>) docGroup.get("operands");
+    private Map<String, Object> mergeCollection(Map<String, Object> collection1,
+            Map<String, Object> collection2) {
+        LinkedHashMap<String, Object> docGroup = KoralObjectGenerator
+                .makeDocGroup("and");
+        ArrayList<Object> operands = (ArrayList<Object>) docGroup
+                .get("operands");
         if (collection1 == null || collection1.isEmpty()) {
             return collection2;
-        } else if (collection2 == null || collection2.isEmpty()) {
+        }
+        else if (collection2 == null || collection2.isEmpty()) {
             return collection1;
-        } else {
+        }
+        else {
             operands.add(collection1);
             operands.add(collection2);
-            return docGroup;   
+            return docGroup;
         }
     }
-    
+
     public QuerySerializer addMeta(String cli, String cri, int cls, int crs,
             int num, int pageIndex) {
         MetaQueryBuilder meta = new MetaQueryBuilder();
@@ -253,8 +253,7 @@
         return this;
     }
 
-    @Deprecated
-    public QuerySerializer setCollectionSimple(String collection) {
+    @Deprecated public QuerySerializer setCollectionSimple(String collection) {
         CollectionQueryBuilder qobj = new CollectionQueryBuilder();
         qobj.addResource(collection);
         this.collection = (Map<String, Object>) qobj.raw();
@@ -265,7 +264,8 @@
         CollectionQueryProcessor tree = new CollectionQueryProcessor();
         Map<String, Object> collectionRequest = tree.getRequestMap();
         tree.process(collection);
-        this.collection = (Map<String, Object>) collectionRequest.get("collection");
+        this.collection = (Map<String, Object>) collectionRequest
+                .get("collection");
         this.errors = (List) collectionRequest.get("errors");
         this.warnings = (List) collectionRequest.get("warnings");
         this.messages = (List) collectionRequest.get("messages");
@@ -277,8 +277,8 @@
         return this;
     }
 
-    public QuerySerializer setDeprCollection
-            (CollectionQueryBuilder collections) {
+    public QuerySerializer setDeprCollection(
+            CollectionQueryBuilder collections) {
         this.collection = (Map<String, Object>) collections.raw();
         return this;
     }
