diff --git a/src/main/java/de/ids_mannheim/korap/query/serialize/CQLTree.java b/src/main/java/de/ids_mannheim/korap/query/serialize/CQLTree.java
index 84f97e3..459c2ed 100644
--- a/src/main/java/de/ids_mannheim/korap/query/serialize/CQLTree.java
+++ b/src/main/java/de/ids_mannheim/korap/query/serialize/CQLTree.java
@@ -1,185 +1,170 @@
 package de.ids_mannheim.korap.query.serialize;
 
+import de.ids_mannheim.korap.util.QueryException;
+import org.z3950.zing.cql.*;
+
 import java.io.IOException;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 
-import org.z3950.zing.cql.CQLAndNode;
-import org.z3950.zing.cql.CQLBooleanNode;
-import org.z3950.zing.cql.CQLNode;
-import org.z3950.zing.cql.CQLOrNode;
-import org.z3950.zing.cql.CQLParseException;
-import org.z3950.zing.cql.CQLParser;
-import org.z3950.zing.cql.CQLRelation;
-import org.z3950.zing.cql.CQLTermNode;
-import org.z3950.zing.cql.Modifier;
-
-import de.ids_mannheim.korap.util.QueryException;
-
 /**
- * 	@author margaretha
- *  
- * */
+ * @author margaretha
+ */
 public class CQLTree extends AbstractSyntaxTree {
-	
-	private static final String VERSION_1_1 = "1.1";
+
+    private static final String VERSION_1_1 = "1.1";
     private static final String VERSION_1_2 = "1.2";
     private static final String INDEX_CQL_SERVERCHOICE = "cql.serverChoice";
-	private static final String INDEX_WORDS = "words";
-	private static final String TERM_RELATION_CQL_1_1 = "scr";
+    private static final String INDEX_WORDS = "words";
+    private static final String TERM_RELATION_CQL_1_1 = "scr";
     private static final String TERM_RELATION_CQL_1_2 = "=";
     private static final String SUPPORTED_RELATION_EXACT = "exact"; // not in the doc    
     private static final String OPERATION_OR = "operation:or";
     private static final String OPERATION_SEQUENCE = "operation:sequence";
     private static final String KORAP_CONTEXT = "http://ids-mannheim.de/ns/KorAP/json-ld/v0.1/context.jsonld";
-    
-	private LinkedHashMap<String,Object> requestMap;
-	private String version;
-	private boolean isCaseSensitive; // default true
-	private StringBuilder sb;
-	
-	/*public CQLTree(String query) throws QueryException {
-		this(query, VERSION_1_2, true);
-	}*/
-	
-	public CQLTree(String query, String version) throws QueryException {
-		this(query, version, true);
-	} 
-	
-	public CQLTree(String query, String version, boolean isCaseSensitive) throws QueryException {
-		this.sb = new StringBuilder();
-		this.version = version;
-		this.isCaseSensitive = isCaseSensitive;
-		this.requestMap = new LinkedHashMap<String,Object>();		
-		requestMap.put("@context", KORAP_CONTEXT);
-		process(query);
-	}
-	
-	
-	@Override
-	public Map<String, Object> getRequestMap() {		
-		return this.requestMap;		
-	}
 
-	@Override
-	public void process(String query) throws QueryException {
-		CQLNode cqlNode = parseQuerytoCQLNode(query);
-		parseCQLNode(cqlNode);
-		String serializedQuery = sb.toString();	
-		requestMap.put("query", serializedQuery);		
-	}
-	
-	private CQLNode parseQuerytoCQLNode(String query) throws QueryException{		
-		try {
-			int compat = -1;
-			switch (version) {
-	            case VERSION_1_1:
-	                compat = CQLParser.V1POINT1;
-	                break;
-	            case VERSION_1_2:
-	                compat = CQLParser.V1POINT2;
-            }			
-			return new CQLParser(compat).parse(query);			
-			
-		} catch (CQLParseException | IOException e) {
-			throw new QueryException("Error parsing CQL");			
-		}
-	}
-	
-	private void parseCQLNode(CQLNode node) throws QueryException {		
-		if (node instanceof CQLTermNode){			
-			parseTermNode((CQLTermNode) node);
-		}
-		else if (node instanceof CQLAndNode ){			
-			parseAndNode((CQLAndNode) node);
-		}
-		else if (node instanceof CQLOrNode){
-			parseOrNode((CQLOrNode) node);
-		}
-		else {
-			throw new QueryException(48, "Only basic search including term-only " +
-				"and boolean operator queries (AND and OR) are currently supported.");
-		}
-	}
-	
-	private void parseTermNode(CQLTermNode node) throws QueryException {		
-		checkTermNode(node);        
+    private LinkedHashMap<String, Object> requestMap;
+    private String version;
+    private boolean isCaseSensitive; // default true
+    private StringBuilder sb;
+
+    public CQLTree(String query) throws QueryException {
+        this(query, VERSION_1_2, true);
+    }
+
+    public CQLTree(String query, String version) throws QueryException {
+        this(query, version, true);
+    }
+
+    public CQLTree(String query, String version, boolean isCaseSensitive) throws QueryException {
+        this.sb = new StringBuilder();
+        this.version = version;
+        this.isCaseSensitive = isCaseSensitive;
+        this.requestMap = new LinkedHashMap<String, Object>();
+        requestMap.put("@context", KORAP_CONTEXT);
+        process(query);
+    }
+
+
+    @Override
+    public Map<String, Object> getRequestMap() {
+        return this.requestMap;
+    }
+
+    @Override
+    public void process(String query) throws QueryException {
+        CQLNode cqlNode = parseQuerytoCQLNode(query);
+        parseCQLNode(cqlNode);
+        String serializedQuery = sb.toString();
+        requestMap.put("query", serializedQuery);
+    }
+
+    private CQLNode parseQuerytoCQLNode(String query) throws QueryException {
+        try {
+            int compat = -1;
+            switch (version) {
+                case VERSION_1_1:
+                    compat = CQLParser.V1POINT1;
+                    break;
+                case VERSION_1_2:
+                    compat = CQLParser.V1POINT2;
+            }
+            return new CQLParser(compat).parse(query);
+
+        } catch (CQLParseException | IOException e) {
+            throw new QueryException("Error parsing CQL");
+        }
+    }
+
+    private void parseCQLNode(CQLNode node) throws QueryException {
+        if (node instanceof CQLTermNode) {
+            parseTermNode((CQLTermNode) node);
+        } else if (node instanceof CQLAndNode) {
+            parseAndNode((CQLAndNode) node);
+        } else if (node instanceof CQLOrNode) {
+            parseOrNode((CQLOrNode) node);
+        } else {
+            throw new QueryException(48, "Only basic search including term-only " +
+                    "and boolean operator queries (AND and OR) are currently supported.");
+        }
+    }
+
+    private void parseTermNode(CQLTermNode node) throws QueryException {
+        checkTermNode(node);
         final String term = node.getTerm();
         if ((term == null) || term.isEmpty()) {
             throw new QueryException(27, "An empty term is unsupported.");
+        } else if (term.contains(" ")) {
+            writeSequence(term);
+        } else {
+            writeTerm(term);
         }
-        else if (term.contains(" ")){	           
-        	writeSequence(term);
-        }
-        else {
-        	writeTerm(term);
-        }
-	}
-	
-	private void parseAndNode(CQLAndNode node) throws QueryException {
-		checkBooleanModifier(node);
-		sb.append("{@type=korap:group, operation=");
-		sb.append(OPERATION_SEQUENCE);
-		sb.append(", distances=[{@type=korap:distance, key=t, min=0, max=0}]");
-		sb.append(", operands=[");
-		parseCQLNode(node.getLeftOperand());
-		sb.append(", ");
+    }
+
+    private void parseAndNode(CQLAndNode node) throws QueryException {
+        checkBooleanModifier(node);
+        sb.append("{@type=korap:group, operation=");
+        sb.append(OPERATION_SEQUENCE);
+        sb.append(", distances=[{@type=korap:distance, key=t, min=0, max=0}]");
+        sb.append(", operands=[");
+        parseCQLNode(node.getLeftOperand());
+        sb.append(", ");
         parseCQLNode(node.getRightOperand());
         sb.append("]}");
-	}
+    }
 
-	private void parseOrNode(CQLOrNode node) throws QueryException {
-		checkBooleanModifier(node);
+    private void parseOrNode(CQLOrNode node) throws QueryException {
+        checkBooleanModifier(node);
         sb.append("{@type=korap:group, operation=");
-		sb.append(OPERATION_OR);
-		sb.append(", operands=[");
-		parseCQLNode(node.getLeftOperand());
-		sb.append(", ");
+        sb.append(OPERATION_OR);
+        sb.append(", operands=[");
+        parseCQLNode(node.getLeftOperand());
+        sb.append(", ");
         parseCQLNode(node.getRightOperand());
-        sb.append("]}");      		
-	}
-	
-	private void writeSequence(String str){
-		String[] terms = str.split(" ");
-		sb.append("{@type=korap:group, operation=");
-		sb.append(OPERATION_SEQUENCE);
-		sb.append(", operands=[");
-		
-		int size = terms.length;
-	    for (int i = 0; i < size; i++) {
-	    	writeTerm(terms[i]);
-	    	if (i < size-1)
-	    		sb.append(", ");
-        }
-	    
-	    sb.append("]}");
-	}
-	
-	private void writeTerm(String term) {		
-		sb.append("{@type=korap:token, wrap={@type=korap:term");
-		if (!isCaseSensitive){
-			sb.append(", caseInsensitive=true");			
-		}		
-		sb.append(", key=");
-		sb.append(term);		
-		sb.append(", layer=orth, match=match:eq}}");		
-	}
+        sb.append("]}");
+    }
 
-	private void checkBooleanModifier(CQLBooleanNode node) throws QueryException {		
-		List<Modifier> modifiers = node.getModifiers();
-        if ((modifiers != null) && !modifiers.isEmpty()) {
-            Modifier modifier = modifiers.get(0);            
-            throw new QueryException(20, "Relation modifier \"" +
-            		modifier.toCQL() + "\" is not supported.");
+    private void writeSequence(String str) {
+        String[] terms = str.split(" ");
+        sb.append("{@type=korap:group, operation=");
+        sb.append(OPERATION_SEQUENCE);
+        sb.append(", operands=[");
+
+        int size = terms.length;
+        for (int i = 0; i < size; i++) {
+            writeTerm(terms[i]);
+            if (i < size - 1)
+                sb.append(", ");
         }
-	}
-	
-	private void checkTermNode(CQLTermNode node) throws QueryException {
-		// only allow "cql.serverChoice" and "words" index
+
+        sb.append("]}");
+    }
+
+    private void writeTerm(String term) {
+        sb.append("{@type=korap:token, wrap={@type=korap:term");
+        if (!isCaseSensitive) {
+            sb.append(", caseInsensitive=true");
+        }
+        sb.append(", key=");
+        sb.append(term);
+        sb.append(", layer=orth, match=match:eq}}");
+    }
+
+    private void checkBooleanModifier(CQLBooleanNode node) throws QueryException {
+        List<Modifier> modifiers = node.getModifiers();
+        if ((modifiers != null) && !modifiers.isEmpty()) {
+            Modifier modifier = modifiers.get(0);
+            throw new QueryException(20, "Relation modifier \"" +
+                    modifier.toCQL() + "\" is not supported.");
+        }
+    }
+
+    private void checkTermNode(CQLTermNode node) throws QueryException {
+        // only allow "cql.serverChoice" and "words" index
         if (!(INDEX_CQL_SERVERCHOICE.equals(node.getIndex()) ||
                 INDEX_WORDS.equals(node.getIndex()))) {
-            throw new QueryException(16, "Index \""+node.getIndex()+"\" is not supported.");
+            throw new QueryException(16, "Index \"" + node.getIndex() + "\" is not supported.");
         }
         // only allow "=" relation without any modifiers
         CQLRelation relation = node.getRelation();
@@ -188,14 +173,14 @@
                 TERM_RELATION_CQL_1_2.equals(baseRel) ||
                 SUPPORTED_RELATION_EXACT.equals(baseRel))) {
             throw new QueryException(19, "Relation \"" +
-                        relation.getBase() + "\" is not supported.");
+                    relation.getBase() + "\" is not supported.");
         }
         List<Modifier> modifiers = relation.getModifiers();
         if ((modifiers != null) && !modifiers.isEmpty()) {
             Modifier modifier = modifiers.get(0);
             throw new QueryException(20, "Relation modifier \"" +
-                            modifier.getValue() + "\" is not supported.");
+                    modifier.getValue() + "\" is not supported.");
         }
-	}
+    }
 
 }
diff --git a/src/main/java/de/ids_mannheim/korap/query/serialize/CollectionQuery.java b/src/main/java/de/ids_mannheim/korap/query/serialize/CollectionQuery.java
index c17bdc2..d6ec238 100644
--- a/src/main/java/de/ids_mannheim/korap/query/serialize/CollectionQuery.java
+++ b/src/main/java/de/ids_mannheim/korap/query/serialize/CollectionQuery.java
@@ -1,7 +1,6 @@
 package de.ids_mannheim.korap.query.serialize;
 
 import com.fasterxml.jackson.core.JsonFactory;
-import com.fasterxml.jackson.core.JsonParser;
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.JsonNode;
 import com.fasterxml.jackson.databind.ObjectMapper;
@@ -37,14 +36,22 @@
 
     public CollectionQuery addResource(String query) {
         try {
-            JsonParser jp = factory.createParser(query);
-            JsonNode m = jp.readValueAsTree();
-            for (JsonNode n : m)
-                this.rq.add(serialzer.treeToValue(n, Map.class));
+            List v = serialzer.readValue(query, LinkedList.class);
+            this.rq.addAll(v);
         } catch (IOException e) {
-            e.printStackTrace();
             throw new IllegalArgumentException("Conversion went wrong!");
         }
+
+
+//        try {
+//            JsonParser jp = factory.createParser(query);
+//            JsonNode m = jp.readValueAsTree();
+//            for (JsonNode n : m)
+//                this.rq.add(serialzer.treeToValue(n, Map.class));
+//        } catch (IOException e) {
+//            e.printStackTrace();
+//            throw new IllegalArgumentException("Conversion went wrong!");
+//        }
         return this;
     }
 
@@ -65,8 +72,8 @@
         return this;
     }
 
-    public CollectionQuery addMetaExtend(String attr, String val) {
-        this.mextension.put(attr, val);
+    public CollectionQuery addMetaExtend(String key, String value) {
+        this.mextension.put(key, value);
         return this;
     }
 
@@ -78,7 +85,7 @@
 
     private List<Map> createFilter() {
         List<Map> mfil = new ArrayList();
-        boolean multypes = this.mfilter.keys().size() > 1;
+        boolean multypes = this.mfilter.keySet().size() > 1;
         String def_key = null;
 
         if (!multypes) {
@@ -87,6 +94,7 @@
         }
 
         List value = this.createValue(this.mfilter);
+
         if (mfilter.values().size() == 1)
             Collections.addAll(mfil, types.createMetaFilter((Map) value.get(0)));
         else {
@@ -142,16 +150,22 @@
             }
 
             if (map.get(key).size() == 1) {
-                Map term = types.createTerm(key, null, map.get(key).toArray(new String[0])[0], null);
+                Map term = types.createTerm(key, null,
+                        map.get(key).toArray(new String[0])[0], null);
                 value.add(term);
             } else {
+                boolean multypes = map.keySet().size() > 1;
                 List g = new ArrayList();
                 for (String v : map.get(key))
                     g.add(types.createTerm(null, v, null));
-                Map group = types.createGroup("and", key, g);
-                value.add(group);
-            }
 
+                if (multypes) {
+                    Map group = types.createGroup("and", key, g);
+                    value.add(group);
+                } else
+                    value.addAll(g);
+
+            }
         }
 
         int idx = 3;
@@ -225,13 +239,18 @@
      *
      * @return
      */
-    public String build() {
+    public JsonNode buildNode() {
+        return serialzer.valueToTree(join());
+    }
+
+    public String buildString() {
         try {
             return serialzer.writeValueAsString(join());
         } catch (JsonProcessingException e) {
             e.printStackTrace();
             return "";
         }
+
     }
 
 
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 75041de..61682bc 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
@@ -9,7 +9,6 @@
 
 import java.io.File;
 import java.io.IOException;
-import java.util.List;
 import java.util.Map;
 
 /**
@@ -17,8 +16,8 @@
  */
 public class QuerySerializer {
 
-	public static String queryLanguageVersion;
-	
+    public static String queryLanguageVersion;
+
     private ObjectMapper mapper;
     private AbstractSyntaxTree ast;
     private org.slf4j.Logger log = LoggerFactory
@@ -118,11 +117,9 @@
             ast = new CosmasTree(query);
         } else if (queryLanguage.toLowerCase().equals("poliqarpplus")) {
             ast = new PoliqarpPlusTree(query);
-        }
-        else if (queryLanguage.toLowerCase().equals("cql")) {
+        } else if (queryLanguage.toLowerCase().equals("cql")) {
             ast = new CQLTree(query);
-        }
-        else {
+        } else {
             throw new QueryException(queryLanguage + " is not a supported query language!");
         }
         Map<String, Object> requestMap = ast.getRequestMap();
@@ -140,12 +137,10 @@
                 ast = new CosmasTree(query);
             } else if (ql.toLowerCase().equals("poliqarpplus")) {
                 ast = new PoliqarpPlusTree(query);
-            } 
-            else if (ql.toLowerCase().equals("cql")){
-            	queryLanguageVersion = "1.2"; // set me
-            	ast = new CQLTree(query);
-            }
-            else {
+            } else if (ql.toLowerCase().equals("cql")) {
+                queryLanguageVersion = "1.2"; // set me
+                ast = new CQLTree(query);
+            } else {
                 throw new QueryException(ql + " is not a supported query language!");
             }
         } catch (QueryException e) {
@@ -166,16 +161,16 @@
             requestMap.put("collections", collection);
             requestMap.put("meta", meta.raw());
             return mapper.writeValueAsString(requestMap);
-        } catch (IOException e){
+        } catch (IOException e) {
             return "";
         }
     }
 
-	public static String getQueryLanguageVersion() {
-		return queryLanguageVersion;
-	}
+    public static String getQueryLanguageVersion() {
+        return queryLanguageVersion;
+    }
 
-	public static void setQueryLanguageVersion(String queryLanguageVersion) {
-		QuerySerializer.queryLanguageVersion = queryLanguageVersion;
-	}
+    public static void setQueryLanguageVersion(String queryLanguageVersion) {
+        QuerySerializer.queryLanguageVersion = queryLanguageVersion;
+    }
 }
diff --git a/src/test/java/MetaQuerySerializationTest.java b/src/test/java/MetaQuerySerializationTest.java
index c5d1fbd..7e430fa 100644
--- a/src/test/java/MetaQuerySerializationTest.java
+++ b/src/test/java/MetaQuerySerializationTest.java
@@ -31,7 +31,7 @@
         b.append("textClass:wissenschaft");
 //        CollectionQuery qu = new CollectionQuery().addMetaFilter(b.toString());
         CollectionQuery query = new CollectionQuery().addMetaFilter(b.toString());
-        System.out.println(query.build());
+        System.out.println(query.buildString());
         System.out.println(query.toCollections());
 //        System.out.println("value reference " + qu.stringify());
 //        System.out.println();
@@ -41,7 +41,7 @@
     public void testSingle() throws IOException {
         CollectionQuery query = new CollectionQuery().addMetaFilter("textClass", "wissenschaft");
 //        System.out.println("------ TEXT SINGLE " + query.stringify());
-        System.out.println(query.build());
+        System.out.println(query.buildString());
     }
 
     @Test
@@ -53,9 +53,9 @@
         b.append(" AND ");
         b.append("author:Goethe");
         CollectionQuery query = new CollectionQuery().addMetaFilter(b.toString());
-        System.out.println("value until/since : " + query.build());
+        System.out.println("value until/since : " + query.buildString());
         System.out.println("meta value until/since " + query.toCollections());
-        Assert.assertEquals("[{\"@type\":\"korap:meta-filter\",\"@value\":{\"@type\":\"korap:group\",\"relation\":\"and\",\"operands\":[{\"@type\":\"korap:term\",\"@field\":\"korap:field#author\",\"@value\":\"Goethe\"},{\"@type\":\"korap:group\",\"@field\":\"korap:field#pubDate\",\"relation\":\"between\",\"operands\":[{\"@type\":\"korap:date\",\"@value\":\"2012-04-01\"},{\"@type\":\"korap:date\",\"@value\":\"2013-04-01\"}]}]}}]", query.build());
+        Assert.assertEquals("[{\"@type\":\"korap:meta-filter\",\"@value\":{\"@type\":\"korap:group\",\"relation\":\"and\",\"operands\":[{\"@type\":\"korap:term\",\"@field\":\"korap:field#author\",\"@value\":\"Goethe\"},{\"@type\":\"korap:group\",\"@field\":\"korap:field#pubDate\",\"relation\":\"between\",\"operands\":[{\"@type\":\"korap:date\",\"@value\":\"2012-04-01\"},{\"@type\":\"korap:date\",\"@value\":\"2013-04-01\"}]}]}}]", query.buildString());
 //        System.out.println();
     }
 
@@ -67,7 +67,7 @@
         b.append("author:Hesse");
         CollectionQuery query = new CollectionQuery().addMetaFilter(b.toString());
         System.out.println("Running date check (until) with additional attribute author");
-        Assert.assertEquals("[{\"@type\":\"korap:meta-filter\",\"@value\":{\"@type\":\"korap:group\",\"relation\":\"and\",\"operands\":[{\"@type\":\"korap:term\",\"@field\":\"korap:field#author\",\"@value\":\"Hesse\"},{\"@type\":\"korap:group\",\"@field\":\"korap:field#pubDate\",\"relation\":\"until\",\"operands\":[{\"@type\":\"korap:date\",\"@value\":\"2013-12-10\"}]}]}}]", query.build());
+        Assert.assertEquals("[{\"@type\":\"korap:meta-filter\",\"@value\":{\"@type\":\"korap:group\",\"relation\":\"and\",\"operands\":[{\"@type\":\"korap:term\",\"@field\":\"korap:field#author\",\"@value\":\"Hesse\"},{\"@type\":\"korap:group\",\"@field\":\"korap:field#pubDate\",\"relation\":\"until\",\"operands\":[{\"@type\":\"korap:date\",\"@value\":\"2013-12-10\"}]}]}}]", query.buildString());
 //        System.out.println("value until : " + query.stringify());
 //        System.out.println();
     }
@@ -79,11 +79,11 @@
         b.append(" AND ");
         b.append("author:Kafka");
         CollectionQuery query = new CollectionQuery().addMetaFilter(b.toString());
-        System.out.println("value since : " + query.build());
+        System.out.println("value since : " + query.buildString());
         System.out.println("meta value since " + query.toCollections());
 //        System.out.println();
         System.out.println("Running date check (since) with additional attribute author");
-        Assert.assertEquals("[{\"@type\":\"korap:meta-filter\",\"@value\":{\"@type\":\"korap:group\",\"relation\":\"and\",\"operands\":[{\"@type\":\"korap:term\",\"@field\":\"korap:field#author\",\"@value\":\"Kafka\"},{\"@type\":\"korap:group\",\"@field\":\"korap:field#pubDate\",\"relation\":\"since\",\"operands\":[{\"@type\":\"korap:date\",\"@value\":\"2013-12-10\"}]}]}}]", query.build());
+        Assert.assertEquals("[{\"@type\":\"korap:meta-filter\",\"@value\":{\"@type\":\"korap:group\",\"relation\":\"and\",\"operands\":[{\"@type\":\"korap:term\",\"@field\":\"korap:field#author\",\"@value\":\"Kafka\"},{\"@type\":\"korap:group\",\"@field\":\"korap:field#pubDate\",\"relation\":\"since\",\"operands\":[{\"@type\":\"korap:date\",\"@value\":\"2013-12-10\"}]}]}}]", query.buildString());
     }
 
     @Test
@@ -129,7 +129,7 @@
         CollectionQuery q = new CollectionQuery().addMetaFilter(b.toString());
         q.addMetaExtend("author", "Hesse");
 
-        System.out.println("--- ALL " + q.build());
+        System.out.println("--- ALL " + q.buildString());
         System.out.println();
 
     }
@@ -141,7 +141,7 @@
         b.append(" AND ");
         b.append("author:Kafka");
         CollectionQuery q = new CollectionQuery().addMetaExtend(b.toString());
-        System.out.println("array repres " + q.build());
+        System.out.println("array repres " + q.buildString());
         System.out.println();
     }
 
@@ -150,7 +150,7 @@
         CollectionQuery q = new CollectionQuery().addMetaFilter("corpusID", "A00");
         q.addMetaExtend("corpusID", "A01");
 
-        System.out.println("results stringified " + q.build());
+        System.out.println("results stringified " + q.buildString());
         System.out.println("results to meta" + q.toCollections());
         System.out.println();
     }
@@ -172,7 +172,7 @@
     @Test
     public void testA00() throws IOException {
         CollectionQuery q = new CollectionQuery().addMetaExtend("corpusID", "A00").addMetaExtend("corpusID", "A01");
-        System.out.println("A meta: " + q.build());
+        System.out.println("A meta: " + q.buildString());
         System.out.println();
     }
 
@@ -181,7 +181,7 @@
         String meta = "[{\"@type\":\"korap:meta-filter\",\"@value\":{\"@type\":\"korap:term\",\"@field\":\"korap:field#corpusID\",\"@value\":\"WPD\"}}]";
         CollectionQuery q = new CollectionQuery().addResource(meta);
         q.addMetaFilter("textClass", "wissenschaft");
-        System.out.println("stringified meta " + q.build());
+        System.out.println("stringified meta " + q.buildString());
         System.out.println("meta string " + q.toCollections());
     }
 
