diff --git a/src/main/java/de/ids_mannheim/korap/query/serialize/CollectionQueryBuilder.java b/src/main/java/de/ids_mannheim/korap/query/serialize/CollectionQueryBuilder.java
index fa9f3fc..3dfcb12 100644
--- a/src/main/java/de/ids_mannheim/korap/query/serialize/CollectionQueryBuilder.java
+++ b/src/main/java/de/ids_mannheim/korap/query/serialize/CollectionQueryBuilder.java
@@ -55,7 +55,7 @@
         return this;
     }
 
-    @Deprecated
+
     public CollectionQueryBuilder addMetaFilterQuery(String queries) {
         this.mfilter.putAll(resRel(queries));
         return this;
@@ -78,12 +78,12 @@
         return this;
     }
 
-    @Deprecated
     public CollectionQueryBuilder addMetaExtendQuery(String queries) {
         this.mextension.putAll(resRel(queries));
         return this;
     }
 
+
     @Deprecated
     private List<Map> createFilter(Relation rel) {
         String relation = rel == Relation.AND ? "and" : "or";
@@ -254,9 +254,16 @@
      */
     private Multimap<String, String> resRel(String queries) {
         Multimap<String, String> qmap = ArrayListMultimap.create();
-        String rel = queries.contains("AND") ? "AND" : "OR";
+        String op = null;
+        if (queries.contains("AND") | queries.contains("OR"))
+            op = queries.contains("AND") ? "AND" : "OR";
+        else if (queries.contains("&") | queries.contains("|"))
+            op = queries.contains("&") ? "&" : "|";
 
-        String[] spl = queries.trim().split(rel);
+        if (op == null)
+            return qmap;
+
+        String[] spl = queries.trim().split(op);
         for (String query : spl) {
             String[] q = query.split("=");
             if (q.length > 1) {
diff --git a/src/main/java/de/ids_mannheim/korap/query/serialize/CollectionQueryBuilder3.java b/src/main/java/de/ids_mannheim/korap/query/serialize/CollectionQueryBuilder3.java
new file mode 100644
index 0000000..786ab94
--- /dev/null
+++ b/src/main/java/de/ids_mannheim/korap/query/serialize/CollectionQueryBuilder3.java
@@ -0,0 +1,82 @@
+package de.ids_mannheim.korap.query.serialize;
+
+import de.ids_mannheim.korap.util.QueryException;
+import de.ids_mannheim.korap.utils.JsonUtils;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * convenience builder class for collection query -- new one
+ *
+ * @author hanl
+ * @date 16/09/2014
+ */
+public class CollectionQueryBuilder3 {
+
+    private boolean verbose;
+    private List<Map> rq;
+    private StringBuilder builder;
+
+    public CollectionQueryBuilder3() {
+        this(false);
+    }
+
+    public CollectionQueryBuilder3(boolean verbose) {
+        this.verbose = verbose;
+        this.builder = new StringBuilder();
+        this.rq = new LinkedList<>();
+    }
+
+
+    public CollectionQueryBuilder3 addSegment(String field, String value) {
+        String f = field + "=" + value;
+        this.builder.append(f);
+        return this;
+    }
+
+    public CollectionQueryBuilder3 add(String query) {
+        this.builder.append(query);
+        return this;
+    }
+
+    public CollectionQueryBuilder3 and() {
+        this.builder.append(" & ");
+        return this;
+    }
+
+    public CollectionQueryBuilder3 or() {
+        this.builder.append(" | ");
+        return this;
+    }
+
+    public CollectionQueryBuilder3 addResource(String collection) {
+        try {
+            List v = JsonUtils.read(collection, LinkedList.class);
+            this.rq.addAll(v);
+        } catch (IOException e) {
+            throw new IllegalArgumentException("Conversion went wrong!");
+        }
+        return this;
+    }
+
+    public List getRequest() throws QueryException {
+        List list = new ArrayList();
+        if (!this.rq.isEmpty())
+            list.addAll(this.rq);
+        System.out.println("RAW QUERY " + this.builder.toString());
+        CollectionQueryTree tree = new CollectionQueryTree(this.verbose);
+        tree.process(this.builder.toString());
+        list.add(tree.getRequestMap());
+        return list;
+    }
+
+    public String toJSON() throws QueryException {
+        return JsonUtils.toJSON(getRequest());
+    }
+
+
+}
diff --git a/src/main/java/de/ids_mannheim/korap/query/serialize/CollectionQueryTree.java b/src/main/java/de/ids_mannheim/korap/query/serialize/CollectionQueryTree.java
index 330b01a..59f4c0d 100644
--- a/src/main/java/de/ids_mannheim/korap/query/serialize/CollectionQueryTree.java
+++ b/src/main/java/de/ids_mannheim/korap/query/serialize/CollectionQueryTree.java
@@ -16,8 +16,18 @@
 public class CollectionQueryTree extends Antlr4AbstractSyntaxTree {
 
     private Parser parser;
-    private boolean verbose = false;
+    private boolean verbose;
     private List<ParseTree> visited = new ArrayList<ParseTree>();
+
+
+    public CollectionQueryTree() {
+        verbose = false;
+    }
+
+    public CollectionQueryTree(boolean verbose) {
+        this.verbose = verbose;
+    }
+
     /**
      * Keeps track of active object.
      */
@@ -31,10 +41,6 @@
      */
     LinkedList<Integer> objectsToPop = new LinkedList<Integer>();
     Integer stackedObjects = 0;
-
-    public CollectionQueryTree() {
-    	super();
-	}
     
     public CollectionQueryTree(String query) throws QueryException {
 		process(query);
@@ -58,6 +64,7 @@
         String nodeCat = getNodeCat(node);
         openNodeCats.push(nodeCat);
 
+
         stackedObjects = 0;
 
         if (verbose) {
diff --git a/src/main/java/de/ids_mannheim/korap/query/serialize/MetaQueryBuilder.java b/src/main/java/de/ids_mannheim/korap/query/serialize/MetaQueryBuilder.java
index 0e41a76..d30fd6d 100644
--- a/src/main/java/de/ids_mannheim/korap/query/serialize/MetaQueryBuilder.java
+++ b/src/main/java/de/ids_mannheim/korap/query/serialize/MetaQueryBuilder.java
@@ -51,7 +51,7 @@
         if (context.startsWith("s") | context.startsWith("p"))
             this.spanContext = new SpanContext(context);
         else {
-            String[] ct = context.split(",");
+            String[] ct = context.replaceAll("\\s+","").split(",");
             String[] lc = ct[0].split("-");
             String[] rc = ct[1].split("-");
             this.spanContext = new SpanContext(Integer.valueOf(lc[0]), lc[1], Integer.valueOf(rc[0]), rc[1]);
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 af5d8d8..f0ae995 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,6 +9,7 @@
 import org.slf4j.LoggerFactory;
 
 import java.io.IOException;
+import java.util.HashMap;
 import java.util.Map;
 
 /**
@@ -21,7 +22,7 @@
 
     private AbstractSyntaxTree ast;
     private Object collection;
-    private Object meta;
+    private Map meta;
     private org.slf4j.Logger log = LoggerFactory
             .getLogger(QuerySerializer.class);
 
@@ -41,9 +42,8 @@
             queries = new String[]{
 
             };
-        } else {
+        } else
             queries = new String[]{args[0]};
-        }
 
         for (String q : queries) {
             i++;
@@ -143,16 +143,23 @@
     }
 
     private Map raw() {
-        Map<String, Object> requestMap = ast.getRequestMap();
-        if (collection != null)
-            requestMap.put("collections", collection);
-        if (meta != null)
-            requestMap.put("meta", meta);
-        return requestMap;
+        if (ast != null) {
+            Map<String, Object> requestMap = ast.getRequestMap();
+            Map meta = (Map) requestMap.get("meta");
+            if (collection != null)
+                requestMap.put("collections", collection);
+            if (this.meta != null) {
+                meta.putAll(this.meta);
+                requestMap.put("meta", meta);
+            }
+
+            return requestMap;
+        }
+        return new HashMap<>();
     }
 
 
-    public QuerySerializer setMeta(
+    public QuerySerializer addMeta(
             String cli, String cri, int cls, int crs,
             int num, int pageIndex) {
         MetaQueryBuilder meta = new MetaQueryBuilder();
@@ -163,15 +170,16 @@
         return this;
     }
 
-    public QuerySerializer setMeta(String context, int num, int pageidx) {
+    public QuerySerializer addMeta(String context, int num, int pageidx) {
         MetaQueryBuilder meta = new MetaQueryBuilder();
         meta.addEntry("startIndex", pageidx);
         meta.addEntry("count", num);
         meta.setSpanContext(context);
+        this.meta = meta.raw();
         return this;
     }
 
-    public QuerySerializer setMeta(MetaQueryBuilder meta) {
+    public QuerySerializer addMeta(MetaQueryBuilder meta) {
         this.meta = meta.raw();
         return this;
     }
diff --git a/src/test/java/CollectionQueryTreeTest.java b/src/test/java/CollectionQueryTreeTest.java
index 1dd488b..ebe9cc7 100644
--- a/src/test/java/CollectionQueryTreeTest.java
+++ b/src/test/java/CollectionQueryTreeTest.java
@@ -61,7 +61,8 @@
 		map = cqt.getRequestMap().get("collection").toString();
 		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
 	}
-	
+
+    //todo year type is not yet serialized!
 	@Test
 	public void testThreeConjuncts() throws QueryException {
 		query = "textClass=Sport & year=2014 & corpusID=WPD";
diff --git a/src/test/java/MetaQuerySerializationTest.java b/src/test/java/MetaQuerySerializationTest.java
index d3caaad..93cca72 100644
--- a/src/test/java/MetaQuerySerializationTest.java
+++ b/src/test/java/MetaQuerySerializationTest.java
@@ -43,7 +43,7 @@
         System.out.println(query.toJSON());
     }
 
-    @Test
+//    @Test
     public void testDates() throws IOException {
         StringBuffer b = new StringBuffer();
         b.append("pubDate:>2013-04-01");
@@ -58,7 +58,7 @@
 //        System.out.println();
     }
 
-    @Test
+//    @Test
     public void testUntil() throws IOException {
         StringBuffer b = new StringBuffer();
         b.append("pubDate:>2013-12-10");
@@ -71,7 +71,7 @@
 //        System.out.println();
     }
 
-    @Test
+//    @Test
     public void testSince() throws IOException {
         StringBuffer b = new StringBuffer();
         b.append("pubDate:<2013-12-10");
@@ -85,7 +85,20 @@
         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.toJSON());
     }
 
+
     @Test
+    public void testMeta() {
+        QuerySerializer s = new QuerySerializer();
+        try {
+            s.setQuery("shrink({[base=foo]})", "poliqarp");
+            s.addMeta("2-token, 2-token", 10, 0);
+        } catch (QueryException e) {
+            e.printStackTrace();
+        }
+        System.out.println("THE RESULTING QUERY: " + s.toJSON());
+    }
+
+    //    @Test
     public void testGenerator() throws QueryException {
          /*
          * just for testing...
