diff --git a/pom.xml b/pom.xml
index e033deb..e4b88f2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,88 +1,84 @@
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-  <modelVersion>4.0.0</modelVersion>
-  <parent>
-      <groupId>KorAP-modules</groupId>
-      <artifactId>KorAP-core-modules</artifactId>
-      <version>1.0</version>
-  </parent>
-  
-  <groupId>KorAP-modules</groupId>
-  <artifactId>KorAP-querySerialization</artifactId>
-  <version>0.0.2</version>
-  <packaging>jar</packaging>
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>KorAP-modules</groupId>
+        <artifactId>KorAP-core-modules</artifactId>
+        <version>1.1</version>
+    </parent>
+
+    <groupId>KorAP-modules</groupId>
+    <artifactId>KorAP-querySerialization</artifactId>
+    <version>0.0.2</version>
+    <packaging>jar</packaging>
 
 
-  <name>KorAP-querySerialization</name>
-  <url>http://maven.apache.org</url>
+    <name>KorAP-querySerialization</name>
+    <url>http://maven.apache.org</url>
 
-  <properties>
-    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-  </properties>
-
-  <dependencies>
-    <dependency>
-    	<groupId>org.antlr</groupId>
-    	<artifactId>antlr4-runtime</artifactId>
-    	<version>4.0</version>
-    </dependency>
-      <dependency>
-          <groupId>com.google.guava</groupId>
-          <artifactId>guava</artifactId>
-          <version>15.0</version>
-      </dependency>
-    <dependency>
-    	<groupId>com.fasterxml.jackson.core</groupId>
-    	<artifactId>jackson-databind</artifactId>
-    	<version>2.2.2</version>
-    </dependency>
-    <dependency>
-    	<groupId>KorAP-modules</groupId>
-    	<artifactId>KorAP-PoliqarpParser</artifactId>
-    	<version>0.05</version>
-    </dependency>
-    <dependency>
-    	<groupId>KorAP-modules</groupId>
-    	<artifactId>KorAP-Cosmas2Parser</artifactId>
-    	<version>LATEST</version>
-    </dependency>
-     <dependency>
-    	<groupId>KorAP-modules</groupId>
-    	<artifactId>KorAP-lucene-index</artifactId>
-    	<version>LATEST</version>
-     </dependency>
-      <dependency>
-          <groupId>junit</groupId>
-          <artifactId>junit</artifactId>
-          <version>4.11</version>
-          <scope>test</scope>
-      </dependency>
-      <dependency>
-          <groupId>joda-time</groupId>
-          <artifactId>joda-time</artifactId>
-          <version>2.2</version>
-      </dependency>
-      <dependency>
-      	<groupId>commons-lang</groupId>
-      	<artifactId>commons-lang</artifactId>
-      	<version>2.6</version>
-      </dependency>
-  </dependencies>
-  <build>
-    <sourceDirectory>${basedir}/src/main/java</sourceDirectory>
-    <outputDirectory>${basedir}/bin</outputDirectory>
-    <plugins>
-      <plugin>
-	<artifactId>maven-compiler-plugin</artifactId>
-	<version>2.3.2</version>
-	<configuration>
-	  <source>1.7</source>
-	  <target>1.7</target>
-	  <!-- excludes>
-          <exclude>**/CosmasTree.java</exclude>
-      </excludes -->
-	</configuration>
-      </plugin>
-    </plugins>
-  </build>
+    <dependencies>
+        <dependency>
+            <groupId>org.antlr</groupId>
+            <artifactId>antlr4-runtime</artifactId>
+            <version>4.0</version>
+        </dependency>
+        <dependency>
+            <groupId>com.google.guava</groupId>
+            <artifactId>guava</artifactId>
+            <version>15.0</version>
+        </dependency>
+        <dependency>
+            <groupId>com.fasterxml.jackson.core</groupId>
+            <artifactId>jackson-databind</artifactId>
+            <version>2.2.2</version>
+        </dependency>
+        <dependency>
+            <groupId>KorAP-modules</groupId>
+            <artifactId>KorAP-PoliqarpParser</artifactId>
+            <version>0.05</version>
+        </dependency>
+        <dependency>
+            <groupId>KorAP-modules</groupId>
+            <artifactId>KorAP-Cosmas2Parser</artifactId>
+            <version>LATEST</version>
+        </dependency>
+        <dependency>
+            <groupId>KorAP-modules</groupId>
+            <artifactId>KorAP-lucene-index</artifactId>
+            <version>LATEST</version>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.11</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>joda-time</groupId>
+            <artifactId>joda-time</artifactId>
+            <version>2.2</version>
+        </dependency>
+        <dependency>
+            <groupId>commons-lang</groupId>
+            <artifactId>commons-lang</artifactId>
+            <version>2.6</version>
+        </dependency>
+    </dependencies>
+    <build>
+        <sourceDirectory>${basedir}/src/main/java</sourceDirectory>
+        <outputDirectory>${basedir}/bin</outputDirectory>
+        <plugins>
+            <plugin>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <version>2.3.2</version>
+                <configuration>
+                    <source>1.7</source>
+                    <target>1.7</target>
+                    <!-- excludes>
+                        <exclude>**/CosmasTree.java</exclude>
+                    </excludes -->
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
 </project>
diff --git a/src/main/java/LayerTranslator.java b/src/main/java/LayerTranslator.java
new file mode 100644
index 0000000..5ab9783
--- /dev/null
+++ b/src/main/java/LayerTranslator.java
@@ -0,0 +1,33 @@
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author hanl
+ * @date 24/01/2014
+ */
+public class LayerTranslator {
+
+    //fixme: standardize
+    private String[] bases = new String[]{"morph", "lemma", "mds", "dep"};
+    private Map<String, String> mapper;
+
+
+    public LayerTranslator() {
+        mapper = new HashMap<>();
+    }
+
+    public void set(String m, String l, String mds, String dep) {
+        mapper.clear();
+        mapper.put(bases[0], m);
+        mapper.put(bases[1], l);
+        mapper.put(bases[2], mds);
+        mapper.put(bases[3], dep);
+    }
+
+    public String translate(String base) {
+        String r = mapper.get(base);
+        if (r != null)
+            return r;
+        return "";
+    }
+}
diff --git a/src/main/java/de/ids_mannheim/korap/query/serialize/MetaQuery.java b/src/main/java/de/ids_mannheim/korap/query/serialize/CollectionQuery.java
similarity index 88%
rename from src/main/java/de/ids_mannheim/korap/query/serialize/MetaQuery.java
rename to src/main/java/de/ids_mannheim/korap/query/serialize/CollectionQuery.java
index 2d81800..ed1d5ef 100644
--- a/src/main/java/de/ids_mannheim/korap/query/serialize/MetaQuery.java
+++ b/src/main/java/de/ids_mannheim/korap/query/serialize/CollectionQuery.java
@@ -15,7 +15,7 @@
  * @author hanl
  * @date 06/12/2013
  */
-public class MetaQuery {
+public class CollectionQuery {
 
     private JsonFactory factory;
     private MetaTypes types;
@@ -24,7 +24,7 @@
     private List<Map> mfil;
     private List<Map> mext;
 
-    public MetaQuery() {
+    public CollectionQuery() {
         this.serialzer = new ObjectMapper();
         this.rq = new ArrayList<>();
         this.mfil = new ArrayList<>();
@@ -33,7 +33,7 @@
         this.types = new MetaTypes();
     }
 
-    public MetaQuery addResource(String query) {
+    public CollectionQuery addResource(String query) {
         try {
             JsonParser jp = factory.createParser(query);
             JsonNode m = jp.readValueAsTree();
@@ -46,7 +46,7 @@
         return this;
     }
 
-    public MetaQuery addResources(List<String> queries) {
+    public CollectionQuery addResources(List<String> queries) {
         for (String query : queries)
             addResource(query);
         return this;
@@ -90,7 +90,6 @@
             value.add(group);
         }
 
-
         for (int i = idx; i < dates.length; i++) {
             if (dates[i] != null) {
                 Map term1 = types.createTerm(dates[i], "korap:date");
@@ -101,8 +100,9 @@
         return value;
     }
 
-    // map can only have one key, value pair. thus, text class can only be added once. Multiple types are not possible!
-    public MetaQuery addMetaFilter(String queries) {
+    // fixme: map can only have one key/value pair. thus,
+    // text class can only be added once. Multiple types are not possible!
+    public CollectionQuery addMetaFilter(String queries) {
         Multimap<String, String> m = resEq(queries);
         boolean multypes = m.keys().size() > 1;
         String def_key = null;
@@ -125,7 +125,7 @@
         return this;
     }
 
-    public MetaQuery addMetaExtend(String queries) {
+    public CollectionQuery addMetaExtend(String queries) {
         Multimap<String, String> m = resEq(queries);
         boolean multypes = m.keys().size() > 1;
         String def_key = null;
@@ -148,18 +148,17 @@
         return this;
     }
 
-    public MetaQuery addMetaFilter(String attr, String val) {
+    public CollectionQuery addMetaFilter(String attr, String val) {
         return addMetaFilter(attr + ":" + val);
     }
 
-    public MetaQuery addMetaExtend(String attr, String val) {
+    public CollectionQuery addMetaExtend(String attr, String val) {
         return addMetaExtend(attr + ":" + val);
     }
 
     private String[] processDates(List<String> dates) {
         if (dates.isEmpty())
             return new String[3];
-        boolean range = false;
         String[] el = new String[dates.size() + 3];
         int idx = 3;
         for (String value : dates) {
@@ -192,7 +191,7 @@
         return cursor;
     }
 
-    private List<Map> getMetaOnly() {
+    private List<Map> getCollectionsOnly() {
         List<Map> cursor = new ArrayList<>(this.mfil);
         cursor.addAll(this.mext);
         return cursor;
@@ -204,7 +203,7 @@
      * @return
      */
     public String stringify() {
-        List meta = getMetaOnly();
+        List meta = getCollectionsOnly();
         if (meta.isEmpty())
             return "";
 
@@ -236,9 +235,9 @@
      *
      * @return
      */
-    public String toMeta() {
+    public String toCollections() {
         Map meta = new LinkedHashMap();
-        meta.put("meta", join());
+        meta.put("collections", join());
 
         try {
             return serialzer.writeValueAsString(meta);
@@ -250,11 +249,12 @@
 
     /**
      * resolves all queries as equal (hierarchy) AND relations
+     *
      * @param queries
      * @return
      */
     private Multimap<String, String> resEq(String queries) {
-	    Multimap<String, String> qmap = ArrayListMultimap.create();
+        Multimap<String, String> qmap = ArrayListMultimap.create();
         String[] spl = queries.split(" AND ");
         for (String query : spl) {
             String[] q = query.split(":");
@@ -263,7 +263,17 @@
             qmap.put(attr, val);
         }
         return qmap;
+    }
 
+
+    /**
+     * resolves query string with AND and OR relations alike!
+     *
+     * @param queries
+     * @return
+     */
+    private Multimap<String, String> resDep(String queries) {
+        return null;
     }
 
 
diff --git a/src/main/java/de/ids_mannheim/korap/query/serialize/CosmasTree.java b/src/main/java/de/ids_mannheim/korap/query/serialize/CosmasTree.java
index a02450f..a772a5c 100644
--- a/src/main/java/de/ids_mannheim/korap/query/serialize/CosmasTree.java
+++ b/src/main/java/de/ids_mannheim/korap/query/serialize/CosmasTree.java
@@ -27,7 +27,7 @@
  */
 public class CosmasTree extends AbstractSyntaxTree {
 	
-	Logger log = LoggerFactory.getLogger(CosmasTree.class);
+	private static Logger log = LoggerFactory.getLogger(CosmasTree.class);
 	
 	private static c2psParser cosmasParser;
 	/*
diff --git a/src/main/java/de/ids_mannheim/korap/query/serialize/MetaTypes.java b/src/main/java/de/ids_mannheim/korap/query/serialize/MetaTypes.java
index 628c777..1a3b07b 100644
--- a/src/main/java/de/ids_mannheim/korap/query/serialize/MetaTypes.java
+++ b/src/main/java/de/ids_mannheim/korap/query/serialize/MetaTypes.java
@@ -94,12 +94,4 @@
         return mapper.readValue(s, Map.class);
     }
 
-    public List listify(String s) throws IOException {
-        return mapper.readValue(s, LinkedList.class);
-    }
-
-    public String stringify(Map m) throws JsonProcessingException {
-        return mapper.writeValueAsString(m);
-    }
-
 }
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 71ca9ad..3252c0f 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
@@ -130,11 +130,11 @@
             throw new QueryException(ql + " is not a supported query language!");
         }
         Map<String, Object> requestMap = ast.getRequestMap();
-        MetaQuery metaQuery = new MetaQuery();
-        metaQuery.addResources(parents);
+        CollectionQuery collectionQuery = new CollectionQuery();
+        collectionQuery.addResources(parents);
 
         try {
-            requestMap.put("meta", metaQuery.raw());
+            requestMap.put("meta", collectionQuery.raw());
             requestMap = QueryUtils.addParameters(requestMap, page, num,
                     cli, cri, cls, crs, cutoff);
             String res = mapper.writeValueAsString(requestMap);
