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 c48f365..fb1a0e3 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
@@ -6,7 +6,6 @@
 import com.google.common.collect.Multiset;
 import de.ids_mannheim.korap.resource.Relation;
 import de.ids_mannheim.korap.utils.JsonUtils;
-import lombok.Data;
 
 import java.io.IOException;
 import java.util.*;
@@ -17,6 +16,7 @@
  * @author hanl
  * @date 06/12/2013
  */
+@Deprecated
 public class CollectionQueryBuilder {
 
     private CollectionTypes types;
@@ -55,6 +55,7 @@
         return this;
     }
 
+    @Deprecated
     public CollectionQueryBuilder addMetaFilterQuery(String queries) {
         this.mfilter.putAll(resRel(queries));
         return this;
@@ -77,12 +78,13 @@
         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";
         List<Map> mfil = new ArrayList();
@@ -109,6 +111,7 @@
         return mfil;
     }
 
+    @Deprecated
     private List<Map> createExtender(Relation rel) {
         String relation = rel == Relation.AND ? "and" : "or";
         List<Map> mex = new ArrayList();
@@ -233,7 +236,7 @@
      *
      * @return
      */
-    public JsonNode buildNode() {
+    public JsonNode toNode() {
         return JsonUtils.valueToTree(join());
     }
 
@@ -299,27 +302,9 @@
 
     }
 
-
     public void clear() {
         this.rq.clear();
         this.mfilter.clear();
         this.mextension.clear();
     }
-
-
-    private static interface Value {
-    }
-
-    @Data
-    private static class Group implements Value {
-        private Relation relation;
-        private List<Term> _terms;
-
-    }
-
-    @Data
-    private static class Term implements Value {
-
-        private String _value;
-    }
 }
diff --git a/src/main/java/de/ids_mannheim/korap/query/serialize/CollectionQueryBuilder2.java b/src/main/java/de/ids_mannheim/korap/query/serialize/CollectionQueryBuilder2.java
new file mode 100644
index 0000000..7f68b64
--- /dev/null
+++ b/src/main/java/de/ids_mannheim/korap/query/serialize/CollectionQueryBuilder2.java
@@ -0,0 +1,77 @@
+package de.ids_mannheim.korap.query.serialize;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import de.ids_mannheim.korap.util.QueryException;
+import de.ids_mannheim.korap.utils.JsonUtils;
+
+import java.io.IOException;
+import java.util.*;
+
+/**
+ * @author hanl
+ * @date 13/05/2014
+ */
+public class CollectionQueryBuilder2 {
+
+    private List<Map> rq;
+    private Map groups;
+    private CollectionTypes types;
+
+    public CollectionQueryBuilder2() {
+        this.rq = new ArrayList<>();
+        this.groups = new HashMap();
+        this.types = new CollectionTypes();
+    }
+
+
+    public CollectionQueryBuilder2 addResource(String collections) {
+        try {
+            List v = JsonUtils.read(collections, LinkedList.class);
+            this.rq.addAll(v);
+        } catch (IOException e) {
+            throw new IllegalArgumentException("Conversion went wrong!");
+        }
+        return this;
+    }
+
+    public CollectionQueryBuilder2 addResources(List<String> queries) {
+        for (String query : queries)
+            addResource(query);
+        return this;
+    }
+
+    public CollectionQueryBuilder2 setQuery(String query) throws QueryException {
+        CollectionQueryTree tree = new CollectionQueryTree();
+        tree.process(query);
+        this.groups = (Map) tree.getRequestMap().get("query");
+        System.out.println("RAW QUERY: " + this.groups);
+        return this;
+    }
+
+    public List raw() {
+        List list = new ArrayList(this.rq);
+        list.add(types.createMetaFilter(this.groups));
+        return list;
+    }
+
+    public String toCollections() {
+        Map value = new HashMap();
+        value.put("collections", raw());
+        return JsonUtils.toJSON(value);
+    }
+
+    public JsonNode toNode() {
+        return JsonUtils.valueToTree(raw());
+    }
+
+    public String toJSON() {
+        return JsonUtils.toJSON(raw());
+    }
+
+
+    // add public filter to original query
+    private void addToGroup() {
+        Map first = this.rq.get(0);
+
+    }
+}
diff --git a/src/main/java/de/ids_mannheim/korap/query/serialize/ExpertFilter.java b/src/main/java/de/ids_mannheim/korap/query/serialize/CollectionQueryTree.java
similarity index 92%
rename from src/main/java/de/ids_mannheim/korap/query/serialize/ExpertFilter.java
rename to src/main/java/de/ids_mannheim/korap/query/serialize/CollectionQueryTree.java
index 5dcf845..588f1a6 100644
--- a/src/main/java/de/ids_mannheim/korap/query/serialize/ExpertFilter.java
+++ b/src/main/java/de/ids_mannheim/korap/query/serialize/CollectionQueryTree.java
@@ -13,7 +13,7 @@
  * @author hanl
  * @date 06/12/2013
  */
-public class ExpertFilter extends Antlr4AbstractSyntaxTree {
+public class CollectionQueryTree extends Antlr4AbstractSyntaxTree {
 
     private Parser parser;
     private boolean verbose = false;
@@ -36,10 +36,6 @@
     LinkedList<Integer> objectsToPop = new LinkedList<Integer>();
     Integer stackedObjects = 0;
 
-
-    public ExpertFilter() {
-    }
-
     @Override
     public void process(String query) throws QueryException {
         ParseTree tree = parseCollectionQuery(query);
@@ -96,7 +92,7 @@
 
             if (valueNodes.size() == 1) {
                 LinkedHashMap<String, Object> term = makeTerm();
-                term.put("attribute", field);
+                term.put("attribute", "korap:field#" + field);
                 term.put("key", valueNodes.get(0).getChild(0).toStringTree(parser));
                 String match = operatorNodes.get(0).getChild(0).toStringTree(parser);
                 term.put("match", "match:" + interpretMatch(match));
@@ -106,14 +102,14 @@
                 ArrayList<Object> termGroupOperands = (ArrayList<Object>) termGroup.get("operands");
 
                 LinkedHashMap<String, Object> term1 = makeTerm();
-                term1.put("attribute", field);
+                term1.put("attribute", "korap:field#" + field);
                 term1.put("key", valueNodes.get(0).getChild(0).toStringTree(parser));
                 String match1 = operatorNodes.get(0).getChild(0).toStringTree(parser);
                 term1.put("match", "match:" + invertInequation(interpretMatch(match1)));
                 termGroupOperands.add(term1);
 
                 LinkedHashMap<String, Object> term2 = makeTerm();
-                term2.put("attribute", field);
+                term2.put("attribute", "korap:field#" + field);
                 term2.put("key", valueNodes.get(1).getChild(0).toStringTree(parser));
                 String match2 = operatorNodes.get(1).getChild(0).toStringTree(parser);
                 term2.put("match", "match:" + interpretMatch(match2));
@@ -124,9 +120,9 @@
 
         }
         objectsToPop.push(stackedObjects);
-		
+
 		/*
-		 ****************************************************************
+         ****************************************************************
 		 **************************************************************** 
 		 *  recursion until 'request' node (root of tree) is processed  *
 		 ****************************************************************
@@ -138,7 +134,7 @@
         }
 
 		/*
-		 **************************************************************
+         **************************************************************
 		 * Stuff that happens after processing the children of a node *
 		 **************************************************************
 		 */
@@ -206,8 +202,8 @@
         if (objectStack.size() > objStackPosition) {
             ArrayList<Object> topObjectOperands = (ArrayList<Object>) objectStack.get(objStackPosition).get("operands");
             topObjectOperands.add(0, object);
-
         } else {
+            // I want the raw object, not a wrapped
             requestMap.put("query", object);
         }
     }
@@ -234,10 +230,10 @@
         }
         // Some things went wrong ...
         catch (Exception e) {
-            System.err.println(e.getMessage());
+            System.err.println("Parsing exception message: " + e.getMessage());
         }
         if (tree == null) {
-            throw new QueryException("Could not parse expert filter query. Make sure it is correct syntax.");
+            throw new QueryException("Could not parse query. Make sure it is correct syntax.");
         }
         // Return the generated tree
         return tree;
@@ -248,7 +244,7 @@
         query = "(1990<year<2010&genre=Sport)|textClass=politk";
         query = "(textClass=wissenschaft & textClass=politik) | textClass=ausland";
         query = "1990<year<2010 & genre=Sport";
-        ExpertFilter filter = new ExpertFilter();
+        CollectionQueryTree filter = new CollectionQueryTree();
 //    	filter.verbose = true;
         try {
             filter.process(query);
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 e3162c1..68173c3 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
@@ -177,14 +177,27 @@
         return this;
     }
 
-    public QuerySerializer setCollection(String collection) {
+    @Deprecated
+    public QuerySerializer setCollectionSimple(String collection) {
         CollectionQueryBuilder qobj = new CollectionQueryBuilder();
         qobj.addResource(collection);
         this.collection = qobj.raw();
         return this;
     }
 
-    public QuerySerializer setCollection(CollectionQueryBuilder collections) {
+    public QuerySerializer setCollection(String collection) throws QueryException {
+        CollectionQueryTree tree = new CollectionQueryTree();
+        tree.process(collection);
+        this.collection = tree.getRequestMap();
+        return this;
+    }
+
+    public QuerySerializer setCollection(CollectionQueryBuilder2 collections) {
+        this.collection = collections.raw();
+        return this;
+    }
+
+    public QuerySerializer setDeprCollection(CollectionQueryBuilder collections) {
         this.collection = collections.raw();
         return this;
     }
diff --git a/src/test/java/CollectionQueryTreeTest.java b/src/test/java/CollectionQueryTreeTest.java
new file mode 100644
index 0000000..81f6eee
--- /dev/null
+++ b/src/test/java/CollectionQueryTreeTest.java
@@ -0,0 +1,85 @@
+import de.ids_mannheim.korap.query.serialize.CollectionQueryBuilder;
+import de.ids_mannheim.korap.query.serialize.CollectionQueryBuilder2;
+import de.ids_mannheim.korap.query.serialize.CollectionQueryTree;
+import de.ids_mannheim.korap.resource.Relation;
+import de.ids_mannheim.korap.util.QueryException;
+import de.ids_mannheim.korap.utils.JsonUtils;
+import de.ids_mannheim.korap.utils.TimeUtils;
+import org.junit.Test;
+
+public class CollectionQueryTreeTest {
+
+    CollectionQueryTree ef;
+    String map;
+    private String query;
+
+    private boolean equalsQueryContent(String res, String query) throws QueryException {
+        res = res.replaceAll(" ", "");
+        ef = new CollectionQueryTree();
+        ef.process(query);
+        String queryMap = ef.getRequestMap().get("query").toString().replaceAll(" ", "");
+        return res.equals(queryMap);
+    }
+
+    @Test
+    public void testSimple() throws QueryException {
+        query = "textClass=Sport";
+        String regex1 = "{@type=korap:filter, filter={@type=korap:term, attribute=textClass, key=Sport, match=match:eq}}";
+        ef = new CollectionQueryTree();
+        ef.process(query);
+        map = JsonUtils.toJSON(ef.getRequestMap());
+//		assertEquals(regex1.replaceAll(" ", ""), map.replaceAll(" ", ""));
+        System.out.println("THE QUERY: " + map);
+    }
+
+
+    @Test
+    public void testComplex() throws QueryException {
+        query = "(textClass=Sport | textClass=ausland) & corpusID=WPD";
+        String regex1 = "{@type=korap:filter, filter={@type=korap:term, attribute=textClass, key=Sport, match=match:eq}}";
+        ef = new CollectionQueryTree();
+        ef.process(query);
+        map = JsonUtils.toJSON(ef.getRequestMap());
+//		assertEquals(regex1.replaceAll(" ", ""), map.replaceAll(" ", ""));
+        System.out.println("THE QUERY 1: " + map);
+    }
+
+    @Test
+    public void testBuilder() throws QueryException {
+        CollectionQueryBuilder2 builder = new CollectionQueryBuilder2();
+        builder.setQuery("(textClass=Sport | textClass=ausland) & corpusID=WPD");
+        System.out.println("BUILDER RESULT: " + builder.toJSON());
+    }
+
+    @Test
+    public void testSimpleBuilder() {
+        CollectionQueryBuilder b = new CollectionQueryBuilder();
+        b.addMetaFilter("corpusID", "WPD");
+        b.addMetaFilter("textClass", "wissenschaft");
+        b.setFilterAttributeRelation(Relation.AND);
+        System.out.println("SIMPLE BUILDER RESULT: " + b.toCollections());
+    }
+
+    // old builder pubDate query
+    @Test
+    public void testDateQuery() {
+        CollectionQueryBuilder b = new CollectionQueryBuilder();
+        String query = "pubDate=>" + TimeUtils.getNow().getMillis();
+        query = query + " AND pubDate=<" + TimeUtils.getNow().getMillis();
+        b.addMetaFilterQuery(query);
+        b.setFilterAttributeRelation(Relation.AND);
+        System.out.println("FINAL RESOURCE: " + b.toCollections());
+    }
+
+    @Test
+    public void testDateNewQuery() throws QueryException {
+        // search for pubDate between 1990 and 2010!
+        String query = "1990<pubDate<2010 & genre=Sport";
+        CollectionQueryBuilder2 q = new CollectionQueryBuilder2();
+        q.setQuery(query);
+        System.out.println("DATE QUERY RESULT: " + q.toJSON());
+    }
+
+
+}
+
diff --git a/src/test/java/ExpertFilterTest.java b/src/test/java/ExpertFilterTest.java
deleted file mode 100644
index 1182f93..0000000
--- a/src/test/java/ExpertFilterTest.java
+++ /dev/null
@@ -1,34 +0,0 @@
-import static org.junit.Assert.*;
-
-import org.junit.Test;
-
-import de.ids_mannheim.korap.query.serialize.ExpertFilter;
-import de.ids_mannheim.korap.util.QueryException;
-
-public class ExpertFilterTest {
-	
-	ExpertFilter ef;
-	String map;
-	private String query;
-
-	private boolean equalsQueryContent(String res, String query) throws QueryException {
-		res = res.replaceAll(" ", "");
-		ef = new ExpertFilter();
-		ef.process(query);
-		String queryMap = ef.getRequestMap().get("query").toString().replaceAll(" ", "");
-		return res.equals(queryMap);
-	}
-	
-	@Test
-	public void testSimple() throws QueryException {
-		query = "textClass=Sport";
-		String regex1 = "{@type=korap:filter, filter={@type=korap:term, attribute=textClass, key=Sport, match=match:eq}}";
-		ef = new ExpertFilter();
-		ef.process(query);
-		map = ef.getRequestMap().toString();
-		assertEquals(regex1.replaceAll(" ", ""), map.replaceAll(" ", ""));
-	}
-	
-	
-}
-
