diff --git a/dependency-reduced-pom.xml b/dependency-reduced-pom.xml
index e2a1bce..4102f20 100644
--- a/dependency-reduced-pom.xml
+++ b/dependency-reduced-pom.xml
@@ -4,7 +4,7 @@
   <groupId>de.ids_mannheim.korap</groupId>
   <artifactId>Kustvakt-core</artifactId>
   <name>Kustvakt core</name>
-  <version>0.58</version>
+  <version>0.59</version>
   <description>Kustvakt core, basic rest api for testing purposes and default
         interfaces</description>
   <build>
@@ -13,7 +13,7 @@
         <filtering>true</filtering>
         <directory>src/main/resources</directory>
         <includes>
-          <include>**/*.prop</include>
+          <include>**/*.info</include>
           <include>**/*.xml</include>
           <include>**/*.conf</include>
           <include>**/*.properties</include>
@@ -64,10 +64,14 @@
       </plugin>
       <plugin>
         <artifactId>maven-surefire-plugin</artifactId>
-        <version>2.9</version>
+        <version>2.19.1</version>
         <configuration>
+          <reuseForks>false</reuseForks>
+          <forkCount>1</forkCount>
+          <threadCount>10</threadCount>
           <excludes>
             <exclude>**/*APITest.java</exclude>
+            <exclude>de/ids_mannheim/korap/suites/*.java</exclude>
           </excludes>
           <includes>
             <include>de/ids_mannheim/korap/**/*.java</include>
@@ -128,7 +132,7 @@
                   <goal>shade</goal>
                 </goals>
                 <configuration>
-                  <finalName>Kustvakt-core-${project.version}-light</finalName>
+                  <finalName>Kustvakt-core-0.59-light</finalName>
                   <transformers>
                     <transformer>
                       <mainClass>de.ids_mannheim.korap.web.KustvaktBaseServer</mainClass>
@@ -158,22 +162,6 @@
       </build>
     </profile>
   </profiles>
-  <repositories>
-    <repository>
-      <id>codehaus-release-repo</id>
-      <name>Codehaus Release Repo</name>
-      <url>http://repository.codehaus.org</url>
-    </repository>
-    <repository>
-      <id>central</id>
-      <url>http://repo1.maven.org/maven2/</url>
-    </repository>
-    <repository>
-      <snapshots />
-      <id>sonatype</id>
-      <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
-    </repository>
-  </repositories>
   <dependencies>
     <dependency>
       <groupId>com.sun.jersey.jersey-test-framework</groupId>
@@ -186,6 +174,10 @@
           <groupId>javax.servlet</groupId>
         </exclusion>
         <exclusion>
+          <artifactId>jersey-servlet</artifactId>
+          <groupId>com.sun.jersey</groupId>
+        </exclusion>
+        <exclusion>
           <artifactId>jersey-client</artifactId>
           <groupId>com.sun.jersey</groupId>
         </exclusion>
diff --git a/pom.xml b/pom.xml
index 32ef711..f89de18 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,7 +5,7 @@
     <modelVersion>4.0.0</modelVersion>
     <groupId>de.ids_mannheim.korap</groupId>
     <artifactId>Kustvakt-core</artifactId>
-    <version>0.58</version>
+    <version>0.59.1</version>
     <packaging>jar</packaging>
     <name>Kustvakt core</name>
     <description>Kustvakt core, basic rest api for testing purposes and default
@@ -83,7 +83,7 @@
                 <directory>src/main/resources</directory>
                 <filtering>true</filtering>
                 <includes>
-                    <include>**/*.prop</include>
+                    <include>**/*.info</include>
                     <include>**/*.xml</include>
                     <include>**/*.conf</include>
                     <include>**/*.properties</include>
@@ -99,6 +99,7 @@
                     <include>**/*.prop</include>
                     <include>**/*.xml</include>
                     <include>**/*.conf</include>
+                    <include>**/*.info</include>
                     <include>**/*.properties</include>
                 </includes>
             </testResource>
@@ -108,7 +109,7 @@
                 <includes>
                     <!--<include>**/*.prop</include>-->
                     <!--<include>**/*.xml</include>-->
-                    <!--<include>**/*.conf</include>-->
+                    <include>**/*.info</include>
                     <include>**/*.properties</include>
                     <!--<include>**/*.sql</include>-->
                 </includes>
@@ -143,10 +144,15 @@
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-surefire-plugin</artifactId>
-                <version>2.9</version>
+                <version>2.19.1</version>
                 <configuration>
+                    <reuseForks>false</reuseForks>
+                    <forkCount>1</forkCount>
+                    <threadCount>10</threadCount>
+
                     <excludes>
                         <exclude>**/*APITest.java</exclude>
+                        <exclude>de/ids_mannheim/korap/suites/*.java</exclude>
                     </excludes>
                     <includes>
                         <include>de/ids_mannheim/korap/**/*.java</include>
@@ -321,7 +327,7 @@
         <dependency>
             <groupId>de.ids_mannheim.korap</groupId>
             <artifactId>Krill</artifactId>
-            <version>0.55.3</version>
+            <version>0.55.5</version>
             <exclusions>
                 <exclusion>
                     <groupId>org.xerial</groupId>
@@ -361,7 +367,13 @@
         <dependency>
             <groupId>org.springframework</groupId>
             <artifactId>spring-context-support</artifactId>
-            <version>4.0.5.RELEASE</version>
+            <version>4.1.6.RELEASE</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-test</artifactId>
+            <version>4.1.6.RELEASE</version>
+            <scope>compile</scope>
         </dependency>
 
         <!-- apparently this order prevents the spring schemas from being overriden in META-INF/spring.schemas, thus must stay like this
@@ -369,12 +381,12 @@
         <dependency>
             <groupId>org.springframework</groupId>
             <artifactId>spring-aop</artifactId>
-            <version>4.0.5.RELEASE</version>
+            <version>4.1.6.RELEASE</version>
         </dependency>
         <dependency>
             <groupId>org.springframework</groupId>
             <artifactId>spring-aspects</artifactId>
-            <version>4.0.5.RELEASE</version>
+            <version>4.1.6.RELEASE</version>
         </dependency>
 
         <!-- copied from extension -->
diff --git a/src/main/java/de/ids_mannheim/korap/config/BeanConfiguration.java b/src/main/java/de/ids_mannheim/korap/config/BeanConfiguration.java
index 8702b28..a9df16b 100644
--- a/src/main/java/de/ids_mannheim/korap/config/BeanConfiguration.java
+++ b/src/main/java/de/ids_mannheim/korap/config/BeanConfiguration.java
@@ -18,6 +18,7 @@
  * Date: 10/9/13
  * Time: 11:20 AM
  */
+@Deprecated
 public class BeanConfiguration {
 
     private static final String CONFIG_FILE = "light-config.xml";
diff --git a/src/main/java/de/ids_mannheim/korap/config/BeansFactory.java b/src/main/java/de/ids_mannheim/korap/config/BeansFactory.java
new file mode 100644
index 0000000..b2ea511
--- /dev/null
+++ b/src/main/java/de/ids_mannheim/korap/config/BeansFactory.java
@@ -0,0 +1,128 @@
+package de.ids_mannheim.korap.config;
+
+import de.ids_mannheim.korap.interfaces.db.ResourceOperationIface;
+import de.ids_mannheim.korap.interfaces.db.UserDataDbIface;
+import de.ids_mannheim.korap.resources.KustvaktResource;
+import de.ids_mannheim.korap.user.Userdata;
+import de.ids_mannheim.korap.web.utils.KustvaktResponseHandler;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+import org.springframework.context.support.FileSystemXmlApplicationContext;
+
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
+import java.util.Collection;
+
+/**
+ * User: hanl
+ * Date: 10/9/13
+ * Time: 11:20 AM
+ */
+public class BeansFactory {
+
+    private static final String CONFIG_FILE = "light-config.xml";
+
+    private static ContextHolder beanHolder;
+
+    //todo: allow this for external plugin systems that are not kustvakt specific
+    @Deprecated
+    public static void setCustomBeansHolder(ContextHolder holder) {
+        beanHolder = holder;
+    }
+
+    public static synchronized ContextHolder getKustvaktContext() {
+        return beanHolder;
+    }
+
+    public static synchronized ContextHolder getKustvaktContext(int i) {
+        return beanHolder;
+    }
+
+    public static synchronized TypeBeanFactory getTypeFactory() {
+        return new TypeBeanFactory(beanHolder);
+    }
+
+    public static int loadClasspathContext(String... files) {
+        ApplicationContext context;
+        if (files.length == 0)
+            context = new ClassPathXmlApplicationContext(CONFIG_FILE);
+        else
+            context = new ClassPathXmlApplicationContext(files);
+        ContextHolder h = new ContextHolder(context) {
+        };
+        BeansFactory.beanHolder = h;
+        //        return BeansFactory.beanHolder.indexOf(h);
+        return 0;
+    }
+
+    public static synchronized int addApplicationContext(
+            ApplicationContext context) {
+        ContextHolder h = new ContextHolder(context) {
+        };
+        BeansFactory.beanHolder = h;
+        //        return BeansFactory.beanHolder.indexOf(h);
+        return 0;
+    }
+
+    public static synchronized void setKustvaktContext(ContextHolder holder) {
+        BeansFactory.beanHolder = holder;
+    }
+
+    public static synchronized int setApplicationContext(
+            ApplicationContext context) {
+        ContextHolder h = new ContextHolder(context) {
+        };
+        BeansFactory.beanHolder = h;
+        return 0;
+    }
+
+    public static synchronized int loadFileContext(String filepath) {
+        ApplicationContext context = new FileSystemXmlApplicationContext(
+                "file:" + filepath);
+        ContextHolder h = new ContextHolder(context) {
+        };
+        BeansFactory.beanHolder = h;
+        return 0;
+    }
+
+    public static void closeApplication() {
+        BeansFactory.beanHolder = null;
+    }
+
+    //todo: set response handler
+    @Deprecated
+    public static KustvaktResponseHandler getResponseHandler() {
+        return null;
+    }
+
+    public BeansFactory() {
+    }
+
+    public static class TypeBeanFactory {
+
+        private ContextHolder holder;
+
+        private TypeBeanFactory(ContextHolder holder) {
+            this.holder = holder;
+        }
+
+        public <T> T getTypedBean(Collection objs, Class type) {
+            for (Object o : objs) {
+                Type gtype = o.getClass().getGenericInterfaces()[0];
+                if (gtype instanceof ParameterizedType) {
+                    ParameterizedType ptype = (ParameterizedType) gtype;
+                    Object ctype = ptype.getActualTypeArguments()[0];
+                    if (ctype.equals(type))
+                        return (T) o;
+                }
+            }
+            throw new RuntimeException("Could not find typed bean in context for class '"+type+"'");
+        }
+
+        @Deprecated
+        public UserDataDbIface getUserDaoInstance(
+                Class<? extends Userdata> type) {
+            return getTypedBean(this.holder.getUserDataDaos(), type);
+        }
+    }
+}
diff --git a/src/main/java/de/ids_mannheim/korap/config/ContextHolder.java b/src/main/java/de/ids_mannheim/korap/config/ContextHolder.java
new file mode 100644
index 0000000..02e7232
--- /dev/null
+++ b/src/main/java/de/ids_mannheim/korap/config/ContextHolder.java
@@ -0,0 +1,115 @@
+package de.ids_mannheim.korap.config;
+
+import de.ids_mannheim.korap.interfaces.AuthenticationIface;
+import de.ids_mannheim.korap.interfaces.AuthenticationManagerIface;
+import de.ids_mannheim.korap.interfaces.EncryptionIface;
+import de.ids_mannheim.korap.interfaces.db.*;
+import de.ids_mannheim.korap.web.utils.KustvaktResponseHandler;
+import org.springframework.beans.factory.NoSuchBeanDefinitionException;
+import org.springframework.context.ApplicationContext;
+
+import java.util.Collection;
+
+/**
+ * @author hanl
+ * @date 26/02/2016
+ */
+public abstract class ContextHolder {
+
+    public static final String KUSTVAKT_DB = "kustvakt_db";
+    public static final String KUSTVAKT_ENCRYPTION = "kustvakt_encryption";
+    public static final String KUSTVAKT_AUDITING = "kustvakt_auditing";
+    public static final String KUSTVAKT_CONFIG = "kustvakt_config";
+    public static final String KUSTVAKT_USERDATA = "kustvakt_userdata";
+    public static final String KUSTVAKT_RESOURCES = "kustvakt_resources";
+
+    public static final String KUSTVAKT_AUTHENTICATION_MANAGER = "kustvakt_authenticationmanager";
+    public static final String KUSTVAKT_AUTHPROVIDERS = "kustvakt_authproviders";
+    public static final String KUSTVAKT_USERDB = "kustvakt_userdb";
+    public static final String KUSTVAKT_POLICIES = "kustvakt_policies";
+
+    private ApplicationContext context = null;
+    private DefaultHandler handler;
+
+    public ContextHolder(ApplicationContext context) {
+        this.handler = new DefaultHandler();
+        this.context = context;
+        // todo: better method?!
+        KustvaktResponseHandler.init(getAuditingProvider());
+    }
+
+    protected <T> T getBean(Class<T> clazz) {
+        if (this.context != null) {
+            try {
+                return context.getBean(clazz);
+            }catch (NoSuchBeanDefinitionException e) {
+                // do nothing
+            }
+        }
+        return this.handler.getDefault(clazz);
+    }
+
+    protected <T> T getBean(String name) {
+        T bean = null;
+        if (this.context != null) {
+            try {
+                bean = (T) context.getBean(name);
+            }catch (NoSuchBeanDefinitionException e) {
+                // do nothing
+                bean = (T) this.handler.getDefault(name);
+            }
+        }
+
+        return bean;
+    }
+
+    public AuditingIface getAuditingProvider() {
+        return (AuditingIface) getBean(KUSTVAKT_AUDITING);
+    }
+
+    public <T extends KustvaktConfiguration> T getConfiguration() {
+        return (T) getBean(KUSTVAKT_CONFIG);
+    }
+
+    public PersistenceClient getPersistenceClient() {
+        return getBean(KUSTVAKT_DB);
+    }
+
+    public Collection<UserDataDbIface> getUserDataDaos() {
+        return getBean(KUSTVAKT_USERDATA);
+    }
+
+    public EncryptionIface getEncryption() {
+        return getBean(KUSTVAKT_ENCRYPTION);
+    }
+
+    public AuthenticationManagerIface getAuthenticationManager() {
+        return getBean(KUSTVAKT_AUTHENTICATION_MANAGER);
+    }
+
+    public EntityHandlerIface getUserDBHandler() {
+        return getBean(KUSTVAKT_USERDB);
+    }
+
+    public PolicyHandlerIface getPolicyDbProvider() {
+        Object b = getBean(KUSTVAKT_POLICIES);
+        return (PolicyHandlerIface) b;
+    }
+
+
+    public Collection<AuthenticationIface> getAuthProviders() {
+        return getBean(KUSTVAKT_AUTHPROVIDERS);
+    }
+
+    // todo: !!!!!!!!!!!!!!!!!!!!!!!!!!
+    // todo: more specific --> collection provider, document provider, etc.
+    public Collection<ResourceOperationIface> getResourceProvider() {
+        return getBean(KUSTVAKT_RESOURCES);
+    }
+
+
+    private void finish() {
+        this.getAuditingProvider().finish();
+        this.context = null;
+    }
+}
diff --git a/src/main/java/de/ids_mannheim/korap/config/KustvaktBaseDaoInterface.java b/src/main/java/de/ids_mannheim/korap/config/KustvaktBaseDaoInterface.java
index 34dd36c..cc23238 100644
--- a/src/main/java/de/ids_mannheim/korap/config/KustvaktBaseDaoInterface.java
+++ b/src/main/java/de/ids_mannheim/korap/config/KustvaktBaseDaoInterface.java
@@ -7,4 +7,7 @@
 public interface KustvaktBaseDaoInterface {
 
     int size();
+
+    int truncate();
+
 }
diff --git a/src/main/java/de/ids_mannheim/korap/config/KustvaktCacheManager.java b/src/main/java/de/ids_mannheim/korap/config/KustvaktCacheManager.java
index 8d826ee..f061daa 100644
--- a/src/main/java/de/ids_mannheim/korap/config/KustvaktCacheManager.java
+++ b/src/main/java/de/ids_mannheim/korap/config/KustvaktCacheManager.java
@@ -17,17 +17,15 @@
 
     public static void init() {
         if (!loaded) {
-            System.out.println("LOADING EHCACHE CONFIG FROM FILE");
             InputStream in = null;
             try {
                 in = new FileInputStream(new File("./ehcache.xml"));
             }catch (FileNotFoundException e) {
-                e.printStackTrace();
+                // do nothing
             }
 
             if (in == null) {
-                System.out.println("LOADING EHCACHE FROM CLASSPATH");
-                in = KustvaktCacheManager.class
+                in = KustvaktCacheManager.class.getClassLoader()
                         .getResourceAsStream("ehcache.xml");
             }
             CacheManager.newInstance(in);
diff --git a/src/main/java/de/ids_mannheim/korap/config/KustvaktConfiguration.java b/src/main/java/de/ids_mannheim/korap/config/KustvaktConfiguration.java
index bbf133a..c2f3c0f 100644
--- a/src/main/java/de/ids_mannheim/korap/config/KustvaktConfiguration.java
+++ b/src/main/java/de/ids_mannheim/korap/config/KustvaktConfiguration.java
@@ -29,7 +29,7 @@
     public static final Map<String, Object> KUSTVAKT_USER = new HashMap<>();
 
     static {
-        KUSTVAKT_USER.put(Attributes.ID, 1);
+        KUSTVAKT_USER.put(Attributes.ID, 1000);
         KUSTVAKT_USER.put(Attributes.USERNAME, "kustvakt");
         KUSTVAKT_USER.put(Attributes.PASSWORD, "kustvakt2015");
         KUSTVAKT_USER.put(Attributes.EMAIL, "kustvakt@ids-mannheim.de");
@@ -95,20 +95,7 @@
             throws MalformedURLException {
         maxhits = new Integer(properties.getProperty("maxhits", "50000"));
         returnhits = new Integer(properties.getProperty("returnhits", "50000"));
-        //todo: refactor to krill.indexDir
         indexDir = properties.getProperty("krill.indexDir", "");
-        //        URL url = KustvaktConfiguration.class.getClassLoader()
-        //                .getResource(idir);
-        //        System.out.println("LOADING FILE FROM CLASSPATH? " + url);
-        //        if (!new File(idir).exists() && url != null) {
-        //            indexDir = url.getFile();
-        //        }else
-        //            indexDir = idir;
-        //
-        //        System.out.println(
-        //                "---------------------------------------------------------------");
-        //        System.out.println("INDEX DIR IS: " + indexDir);
-        //        System.out.println("FILE EXISTS? " + new File(indexDir).exists());
         port = new Integer(properties.getProperty("server.port", "8095"));
         // server options
         serverHost = String
diff --git a/src/main/java/de/ids_mannheim/korap/handlers/DocumentDao.java b/src/main/java/de/ids_mannheim/korap/handlers/DocumentDao.java
index 6438d67..4d7df7d 100644
--- a/src/main/java/de/ids_mannheim/korap/handlers/DocumentDao.java
+++ b/src/main/java/de/ids_mannheim/korap/handlers/DocumentDao.java
@@ -83,8 +83,7 @@
                                 doc = new Document(
                                         rs.getString("persistent_id"));
                                 doc.setId(rs.getInt("id"));
-                                doc.setCreated(
-                                        rs.getTimestamp("created").getTime());
+                                doc.setCreated(rs.getLong("created"));
                                 doc.setDisabled(rs.getBoolean("disabled"));
                             }
 
@@ -94,6 +93,7 @@
         }catch (EmptyResultDataAccessException em) {
             return null;
         }catch (DataAccessException e) {
+            e.printStackTrace();
             throw new KustvaktException(StatusCodes.CONNECTION_ERROR);
         }
     }
@@ -209,21 +209,21 @@
     }
 
     @Override
-    public int deleteAll() throws KustvaktException {
+    public int size() {
+        return -1;
+    }
+
+    @Override
+    public int truncate() {
         String sql = "delete from doc_store;";
         try {
             return this.jdbcTemplate.update(sql, new HashMap<String, Object>());
         }catch (DataAccessException e) {
-            throw new KustvaktException(StatusCodes.CONNECTION_ERROR);
+            return -1;
         }
     }
 
     @Override
-    public int size() {
-        return -1;
-    }
-
-    @Override
     public Class<Document> type() {
         return Document.class;
     }
diff --git a/src/main/java/de/ids_mannheim/korap/handlers/EntityDao.java b/src/main/java/de/ids_mannheim/korap/handlers/EntityDao.java
index 5de24a6..aa1e725 100644
--- a/src/main/java/de/ids_mannheim/korap/handlers/EntityDao.java
+++ b/src/main/java/de/ids_mannheim/korap/handlers/EntityDao.java
@@ -53,7 +53,7 @@
             user = this.jdbcTemplate.queryForObject(sql, namedParameters,
                     new RowMapperFactory.UserMapper());
         }catch (EmptyResultDataAccessException ae) {
-            jlog.error("No user found for name '{}'", username);
+            jlog.warn("No user found for name '{}'", username);
             throw new EmptyResultException(username);
         }catch (DataAccessException e) {
             jlog.error("Could not retrieve user for name: " + username, e);
@@ -139,7 +139,6 @@
             np.addValue("acr", System.currentTimeMillis());
             np.addValue("id", k.getId());
 
-            System.out.println("query map " + np.getValues());
             if (user.getId() != -1)
                 query = "INSERT INTO korap_users (id, username, account_lock, "
                         +
@@ -229,6 +228,16 @@
     }
 
     @Override
+    public int truncate() {
+        String sql = "DELETE FROM korap_users;";
+        try {
+            return this.jdbcTemplate.update(sql, new HashMap<String, Object>());
+        }catch (DataAccessException e) {
+            return -1;
+        }
+    }
+
+    @Override
     public int resetPassphrase(String username, String uriToken,
             String passphrase) throws KustvaktException {
         MapSqlParameterSource np = new MapSqlParameterSource();
diff --git a/src/main/java/de/ids_mannheim/korap/handlers/ResourceDao.java b/src/main/java/de/ids_mannheim/korap/handlers/ResourceDao.java
index 2093a13..2f62d4f 100644
--- a/src/main/java/de/ids_mannheim/korap/handlers/ResourceDao.java
+++ b/src/main/java/de/ids_mannheim/korap/handlers/ResourceDao.java
@@ -42,10 +42,26 @@
         return (Class<T>) KustvaktResource.class;
     }
 
+    // todo: testing
     @Override
     public List<T> getResources(Collection<Object> ids, User user)
             throws KustvaktException {
-        return null;
+        String sql =
+                "SELECT rs.*, rt.name_path FROM resource_store as rs inner join resource_tree as rt"
+                        + " on rs.id=rt.child_id WHERE rs.id IN (:ids);";
+        MapSqlParameterSource parameters = new MapSqlParameterSource();
+        parameters.addValue("ids", ids);
+        try {
+            return (List<T>) this.jdbcTemplate.query(sql, parameters,
+                    new RowMapperFactory.ResourceMapper());
+        }catch (DataAccessException e) {
+            log.error(
+                    "Exception during database retrieval for ids '" + ids + "'",
+                    e);
+            throw new dbException(user.getId(), "resource_store",
+                    StatusCodes.DB_GET_FAILED, ids.toString());
+        }
+
     }
 
     @Override
@@ -184,16 +200,6 @@
     }
 
     @Override
-    public int deleteAll() throws KustvaktException {
-        final String sql = "DELETE FROM resource_store;";
-        try {
-            return this.jdbcTemplate.update(sql, new HashMap<String, Object>());
-        }catch (DataAccessException e) {
-            throw new KustvaktException(StatusCodes.CONNECTION_ERROR);
-        }
-    }
-
-    @Override
     public int size() {
         final String sql = "SELECT COUNT(*) FROM resource_store;";
         try {
@@ -204,4 +210,14 @@
             return 0;
         }
     }
+
+    @Override
+    public int truncate() {
+        final String sql = "DELETE FROM resource_store;";
+        try {
+            return this.jdbcTemplate.update(sql, new HashMap<String, Object>());
+        }catch (DataAccessException e) {
+            return -1;
+        }
+    }
 }
diff --git a/src/main/java/de/ids_mannheim/korap/handlers/UserDetailsDao.java b/src/main/java/de/ids_mannheim/korap/handlers/UserDetailsDao.java
index e301ff5..42b0b60 100644
--- a/src/main/java/de/ids_mannheim/korap/handlers/UserDetailsDao.java
+++ b/src/main/java/de/ids_mannheim/korap/handlers/UserDetailsDao.java
@@ -58,6 +58,7 @@
         try {
             return this.jdbcTemplate.update(sql, source);
         }catch (DataAccessException e) {
+            e.printStackTrace();
             return -1;
         }
     }
diff --git a/src/main/java/de/ids_mannheim/korap/handlers/UserSettingsDao.java b/src/main/java/de/ids_mannheim/korap/handlers/UserSettingsDao.java
index 6b9300f..6bb8453 100644
--- a/src/main/java/de/ids_mannheim/korap/handlers/UserSettingsDao.java
+++ b/src/main/java/de/ids_mannheim/korap/handlers/UserSettingsDao.java
@@ -6,6 +6,8 @@
 import de.ids_mannheim.korap.interfaces.db.UserDataDbIface;
 import de.ids_mannheim.korap.user.User;
 import de.ids_mannheim.korap.user.UserSettings;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.dao.DataAccessException;
 import org.springframework.dao.EmptyResultDataAccessException;
 import org.springframework.jdbc.core.RowMapper;
@@ -23,7 +25,10 @@
  */
 public class UserSettingsDao implements UserDataDbIface<UserSettings> {
 
-    NamedParameterJdbcTemplate jdbcTemplate;
+    private static final Logger jlog = LoggerFactory
+            .getLogger(UserSettingsDao.class);
+
+    private final NamedParameterJdbcTemplate jdbcTemplate;
 
     public UserSettingsDao(PersistenceClient client) {
         this.jdbcTemplate = (NamedParameterJdbcTemplate) client.getSource();
@@ -44,6 +49,8 @@
             return id;
         }catch (DataAccessException e) {
             e.printStackTrace();
+            jlog.error("couldn't store data in db for user with id '{}'",
+                    data.getUserID());
             return -1;
         }
     }
diff --git a/src/main/java/de/ids_mannheim/korap/interfaces/AuthenticationManagerIface.java b/src/main/java/de/ids_mannheim/korap/interfaces/AuthenticationManagerIface.java
index 8204a4f..ca155eb 100644
--- a/src/main/java/de/ids_mannheim/korap/interfaces/AuthenticationManagerIface.java
+++ b/src/main/java/de/ids_mannheim/korap/interfaces/AuthenticationManagerIface.java
@@ -1,7 +1,9 @@
 package de.ids_mannheim.korap.interfaces;
 
 import de.ids_mannheim.korap.exceptions.KustvaktException;
-import de.ids_mannheim.korap.user.*;
+import de.ids_mannheim.korap.user.TokenContext;
+import de.ids_mannheim.korap.user.User;
+import de.ids_mannheim.korap.user.Userdata;
 
 import java.util.HashMap;
 import java.util.Map;
@@ -63,7 +65,6 @@
 
     public abstract void updateUserData(Userdata data) throws KustvaktException;
 
-
     public abstract Object[] validateResetPasswordRequest(String username,
             String email) throws KustvaktException;
 
@@ -73,8 +74,7 @@
     public abstract void confirmRegistration(String uriFragment,
             String username) throws KustvaktException;
 
-    @Override
-    public String toString() {
+    public String providerList() {
         return "provider list: " + this.providers.toString();
     }
 }
diff --git a/src/main/java/de/ids_mannheim/korap/interfaces/db/EntityHandlerIface.java b/src/main/java/de/ids_mannheim/korap/interfaces/db/EntityHandlerIface.java
index b596b55..a844fbc 100644
--- a/src/main/java/de/ids_mannheim/korap/interfaces/db/EntityHandlerIface.java
+++ b/src/main/java/de/ids_mannheim/korap/interfaces/db/EntityHandlerIface.java
@@ -20,6 +20,8 @@
 
     int deleteAccount(Integer userid) throws KustvaktException;
 
+    int truncate() throws KustvaktException;
+
     int resetPassphrase(String username, String uriToken, String passphrase)
             throws KustvaktException;
 
diff --git a/src/main/java/de/ids_mannheim/korap/interfaces/db/PersistenceClient.java b/src/main/java/de/ids_mannheim/korap/interfaces/db/PersistenceClient.java
index 7b8c58a..573d346 100644
--- a/src/main/java/de/ids_mannheim/korap/interfaces/db/PersistenceClient.java
+++ b/src/main/java/de/ids_mannheim/korap/interfaces/db/PersistenceClient.java
@@ -9,7 +9,7 @@
 
     private SOURCE source;
     private TYPE type;
-    @Deprecated
+
     protected String database;
     private InputStream schema;
 
diff --git a/src/main/java/de/ids_mannheim/korap/interfaces/db/ResourceOperationIface.java b/src/main/java/de/ids_mannheim/korap/interfaces/db/ResourceOperationIface.java
index 2682604..6666d49 100644
--- a/src/main/java/de/ids_mannheim/korap/interfaces/db/ResourceOperationIface.java
+++ b/src/main/java/de/ids_mannheim/korap/interfaces/db/ResourceOperationIface.java
@@ -39,6 +39,4 @@
 
     //    public void deleteResource(Integer id, User user) throws KorAPException;
     int deleteResource(String id, User user) throws KustvaktException;
-
-    int deleteAll() throws KustvaktException;
 }
diff --git a/src/main/java/de/ids_mannheim/korap/interfaces/defaults/DefaultAuditing.java b/src/main/java/de/ids_mannheim/korap/interfaces/defaults/DefaultAuditing.java
index bbf895a..ef76c8c 100644
--- a/src/main/java/de/ids_mannheim/korap/interfaces/defaults/DefaultAuditing.java
+++ b/src/main/java/de/ids_mannheim/korap/interfaces/defaults/DefaultAuditing.java
@@ -1,7 +1,7 @@
 package de.ids_mannheim.korap.interfaces.defaults;
 
 import de.ids_mannheim.korap.auditing.AuditRecord;
-import de.ids_mannheim.korap.config.BeanConfiguration;
+import de.ids_mannheim.korap.config.ContextHolder;
 import de.ids_mannheim.korap.config.Configurable;
 import de.ids_mannheim.korap.interfaces.db.AuditingIface;
 import de.ids_mannheim.korap.user.User;
@@ -18,7 +18,7 @@
  * @author hanl
  * @date 05/06/2015
  */
-@Configurable(BeanConfiguration.KUSTVAKT_AUDITING)
+@Configurable(ContextHolder.KUSTVAKT_AUDITING)
 public class DefaultAuditing extends AuditingIface {
 
     private FileOutputStream stream;
diff --git a/src/main/java/de/ids_mannheim/korap/interfaces/defaults/DefaultEncryption.java b/src/main/java/de/ids_mannheim/korap/interfaces/defaults/DefaultEncryption.java
index 2232c01..108188e 100644
--- a/src/main/java/de/ids_mannheim/korap/interfaces/defaults/DefaultEncryption.java
+++ b/src/main/java/de/ids_mannheim/korap/interfaces/defaults/DefaultEncryption.java
@@ -1,6 +1,6 @@
 package de.ids_mannheim.korap.interfaces.defaults;
 
-import de.ids_mannheim.korap.config.BeanConfiguration;
+import de.ids_mannheim.korap.config.ContextHolder;
 import de.ids_mannheim.korap.config.Configurable;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.interfaces.EncryptionIface;
@@ -16,7 +16,7 @@
  * @author hanl
  * @date 05/06/2015
  */
-@Configurable(BeanConfiguration.KUSTVAKT_ENCRYPTION)
+@Configurable(ContextHolder.KUSTVAKT_ENCRYPTION)
 public class DefaultEncryption implements EncryptionIface {
 
     private SecureRandom randomizer;
diff --git a/src/main/java/de/ids_mannheim/korap/interfaces/defaults/KustvaktEncryption.java b/src/main/java/de/ids_mannheim/korap/interfaces/defaults/KustvaktEncryption.java
index dbd3649..1707616 100644
--- a/src/main/java/de/ids_mannheim/korap/interfaces/defaults/KustvaktEncryption.java
+++ b/src/main/java/de/ids_mannheim/korap/interfaces/defaults/KustvaktEncryption.java
@@ -283,7 +283,8 @@
 
     // todo: where applied?
     @Override
-    public Map<String, Object> validateMap(Map<String, Object> map) throws KustvaktException {
+    public Map<String, Object> validateMap(Map<String, Object> map)
+            throws KustvaktException {
         Map<String, Object> safeMap = new HashMap<>();
         KustvaktMap kmap = new KustvaktMap(map);
 
@@ -371,13 +372,12 @@
                     config.getValidationStringLength(), nullable);
         }catch (ValidationException ex) {
             jlog.error("Validation failed! Value '{}' with type '{}'",
-                    new Object[] { input, type, ex.getMessage() });
+                    new Object[] { input, type });
             throw new KustvaktException(StatusCodes.PARAMETER_VALIDATION_ERROR,
                     "invalid value of type " + type, input);
         }
     }
 
-
     public void validate(Object instance) throws KustvaktException {
         if (instance == null)
             return;
diff --git a/src/main/java/de/ids_mannheim/korap/resource/rewrite/CollectionCleanupFilter.java b/src/main/java/de/ids_mannheim/korap/resource/rewrite/CollectionCleanupFilter.java
index 6f12d59..f1c8500 100644
--- a/src/main/java/de/ids_mannheim/korap/resource/rewrite/CollectionCleanupFilter.java
+++ b/src/main/java/de/ids_mannheim/korap/resource/rewrite/CollectionCleanupFilter.java
@@ -2,6 +2,8 @@
 
 import com.fasterxml.jackson.databind.JsonNode;
 import com.fasterxml.jackson.databind.node.ObjectNode;
+import de.ids_mannheim.korap.config.BeanInjectable;
+import de.ids_mannheim.korap.config.ContextHolder;
 import de.ids_mannheim.korap.config.KustvaktConfiguration;
 import de.ids_mannheim.korap.user.User;
 import de.ids_mannheim.korap.utils.JsonUtils;
@@ -12,7 +14,8 @@
  * @author hanl
  * @date 28/07/2015
  */
-public class CollectionCleanupFilter implements RewriteTask.RewriteNodeAt {
+public class CollectionCleanupFilter
+        implements RewriteTask.RewriteNodeAt {
 
     @Override
     public JsonNode preProcess(KoralNode node, KustvaktConfiguration config,
@@ -43,6 +46,7 @@
                     return null;
             }
 
+            // what happens to array nodes?
             if (!root.equals(sub)) {
                 if (sub.isObject()) {
                     ObjectNode ob = (ObjectNode) root;
diff --git a/src/main/java/de/ids_mannheim/korap/resource/rewrite/CollectionConstraint.java b/src/main/java/de/ids_mannheim/korap/resource/rewrite/CollectionConstraint.java
index 7c9daae..8cd37e1 100644
--- a/src/main/java/de/ids_mannheim/korap/resource/rewrite/CollectionConstraint.java
+++ b/src/main/java/de/ids_mannheim/korap/resource/rewrite/CollectionConstraint.java
@@ -1,6 +1,8 @@
 package de.ids_mannheim.korap.resource.rewrite;
 
 import com.fasterxml.jackson.databind.JsonNode;
+import de.ids_mannheim.korap.config.BeanInjectable;
+import de.ids_mannheim.korap.config.ContextHolder;
 import de.ids_mannheim.korap.config.KustvaktConfiguration;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.resources.Corpus;
@@ -12,8 +14,8 @@
  * @author hanl
  * @date 03/07/2015
  */
-// todo: test
-public class CollectionConstraint implements RewriteTask.IterableRewriteAt {
+public class CollectionConstraint
+        implements RewriteTask.IterableRewriteAt {
 
     @Override
     public JsonNode preProcess(KoralNode node, KustvaktConfiguration config,
diff --git a/src/main/java/de/ids_mannheim/korap/resource/rewrite/DocMatchRewrite.java b/src/main/java/de/ids_mannheim/korap/resource/rewrite/DocMatchRewrite.java
index cc58817..a15d536 100644
--- a/src/main/java/de/ids_mannheim/korap/resource/rewrite/DocMatchRewrite.java
+++ b/src/main/java/de/ids_mannheim/korap/resource/rewrite/DocMatchRewrite.java
@@ -1,7 +1,9 @@
 package de.ids_mannheim.korap.resource.rewrite;
 
 import com.fasterxml.jackson.databind.JsonNode;
-import de.ids_mannheim.korap.config.BeanConfiguration;
+import de.ids_mannheim.korap.config.BeanInjectable;
+import de.ids_mannheim.korap.config.BeansFactory;
+import de.ids_mannheim.korap.config.ContextHolder;
 import de.ids_mannheim.korap.config.KustvaktConfiguration;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.handlers.DocumentDao;
@@ -15,32 +17,34 @@
  * @author hanl
  * @date 12/11/2015
  */
-public class DocMatchRewrite implements RewriteTask.IterableRewriteAt {
+//todo : test
+public class DocMatchRewrite
+        implements RewriteTask.IterableRewriteAt, BeanInjectable {
 
     private DocumentDao docDao;
     private Cache cache;
 
     public DocMatchRewrite() {
-        this.docDao = new DocumentDao(
-                BeanConfiguration.getBeans().getPersistenceClient());
         this.cache = CacheManager.getInstance().getCache("documents");
     }
 
     @Override
-    public JsonNode postProcess(KoralNode node) {
+    public void insertBeans(ContextHolder beans) {
+        this.docDao = BeansFactory.getTypeFactory()
+                .getTypedBean(beans.getResourceProvider(), Document.class);
+    }
+
+    @Override
+    public JsonNode postProcess(KoralNode node) throws KustvaktException {
         Document doc = null;
+        if (this.docDao == null)
+            throw new RuntimeException("Document dao must be set!");
 
         if (node.has("docID")) {
             String docID = node.get("docID");
             Element e = this.cache.get(docID);
             if (e == null) {
-                try {
-                    doc = docDao.findbyId(docID, null);
-                }catch (KustvaktException ex) {
-                    ex.printStackTrace();
-                    // todo: what to do here?!
-                }
-
+                doc = docDao.findbyId(docID, null);
                 if (doc != null)
                     this.cache.put(new Element(docID, doc));
             }else
diff --git a/src/main/java/de/ids_mannheim/korap/resource/rewrite/FoundryInject.java b/src/main/java/de/ids_mannheim/korap/resource/rewrite/FoundryInject.java
index e7961f9..1bb0174 100644
--- a/src/main/java/de/ids_mannheim/korap/resource/rewrite/FoundryInject.java
+++ b/src/main/java/de/ids_mannheim/korap/resource/rewrite/FoundryInject.java
@@ -1,26 +1,42 @@
 package de.ids_mannheim.korap.resource.rewrite;
 
 import com.fasterxml.jackson.databind.JsonNode;
-import de.ids_mannheim.korap.config.BeanConfiguration;
+import de.ids_mannheim.korap.config.BeanInjectable;
+import de.ids_mannheim.korap.config.BeansFactory;
+import de.ids_mannheim.korap.config.ContextHolder;
 import de.ids_mannheim.korap.config.KustvaktConfiguration;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.interfaces.db.UserDataDbIface;
 import de.ids_mannheim.korap.resource.LayerMapper;
+import de.ids_mannheim.korap.resources.Foundry;
 import de.ids_mannheim.korap.user.User;
+import de.ids_mannheim.korap.user.UserSettings;
+import edu.emory.mathcs.backport.java.util.Collections;
+
+import java.util.Collection;
 
 /**
  * @author hanl
  * @date 30/06/2015
  */
-public class FoundryInject implements RewriteTask.IterableRewriteAt {
+public class FoundryInject
+        implements RewriteTask.IterableRewriteAt, BeanInjectable {
+
+    private Collection userdaos;
+
+    public FoundryInject() {
+        this.userdaos = Collections.emptyList();
+    }
+
 
     @Override
     public JsonNode preProcess(KoralNode node, KustvaktConfiguration config,
             User user) throws KustvaktException {
         LayerMapper mapper;
-        if (user != null && BeanConfiguration.hasContext()) {
-            UserDataDbIface dao = BeanConfiguration.getBeans()
-                    .getUserSettingsDao();
+
+        if (user != null && !userdaos.isEmpty()) {
+            UserDataDbIface dao = BeansFactory.getTypeFactory()
+                    .getTypedBean(userdaos, UserSettings.class);
             mapper = new LayerMapper(config, dao.get(user));
         }else
             mapper = new LayerMapper(config);
@@ -46,4 +62,9 @@
     public JsonNode postProcess(KoralNode node) {
         return null;
     }
+
+    @Override
+    public <T extends ContextHolder> void insertBeans(T beans) {
+        this.userdaos = beans.getUserDataDaos();
+    }
 }
diff --git a/src/main/java/de/ids_mannheim/korap/resource/rewrite/IdWriter.java b/src/main/java/de/ids_mannheim/korap/resource/rewrite/IdWriter.java
index 737cbe4..66c2e53 100644
--- a/src/main/java/de/ids_mannheim/korap/resource/rewrite/IdWriter.java
+++ b/src/main/java/de/ids_mannheim/korap/resource/rewrite/IdWriter.java
@@ -1,6 +1,8 @@
 package de.ids_mannheim.korap.resource.rewrite;
 
 import com.fasterxml.jackson.databind.JsonNode;
+import de.ids_mannheim.korap.config.BeanInjectable;
+import de.ids_mannheim.korap.config.ContextHolder;
 import de.ids_mannheim.korap.config.KustvaktConfiguration;
 import de.ids_mannheim.korap.user.User;
 
@@ -8,7 +10,8 @@
  * @author hanl
  * @date 25/09/2015
  */
-public class IdWriter implements RewriteTask.RewriteKoralToken {
+public class IdWriter
+        implements RewriteTask.RewriteKoralToken {
 
     private int counter;
 
@@ -34,5 +37,4 @@
             return wrap.path("key").asText();
         return null;
     }
-
 }
diff --git a/src/main/java/de/ids_mannheim/korap/resource/rewrite/MetaConstraint.java b/src/main/java/de/ids_mannheim/korap/resource/rewrite/MetaConstraint.java
index 00aa844..4899fcf 100644
--- a/src/main/java/de/ids_mannheim/korap/resource/rewrite/MetaConstraint.java
+++ b/src/main/java/de/ids_mannheim/korap/resource/rewrite/MetaConstraint.java
@@ -1,6 +1,7 @@
 package de.ids_mannheim.korap.resource.rewrite;
 
 import com.fasterxml.jackson.databind.JsonNode;
+import de.ids_mannheim.korap.config.BeanInjectable;
 import de.ids_mannheim.korap.config.KustvaktConfiguration;
 import de.ids_mannheim.korap.user.User;
 
@@ -8,7 +9,8 @@
  * @author hanl
  * @date 04/07/2015
  */
-public class MetaConstraint implements RewriteTask.RewriteNodeAt {
+public class MetaConstraint
+        implements RewriteTask.RewriteNodeAt {
 
 
     @Override
@@ -33,4 +35,5 @@
     public String at() {
         return "/meta";
     }
+
 }
diff --git a/src/main/java/de/ids_mannheim/korap/resource/rewrite/PublicCollection.java b/src/main/java/de/ids_mannheim/korap/resource/rewrite/PublicCollection.java
index 4cdd1a6..f6a847e 100644
--- a/src/main/java/de/ids_mannheim/korap/resource/rewrite/PublicCollection.java
+++ b/src/main/java/de/ids_mannheim/korap/resource/rewrite/PublicCollection.java
@@ -1,6 +1,7 @@
 package de.ids_mannheim.korap.resource.rewrite;
 
 import com.fasterxml.jackson.databind.JsonNode;
+import de.ids_mannheim.korap.config.BeanInjectable;
 import de.ids_mannheim.korap.config.KustvaktConfiguration;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.resources.Corpus;
@@ -14,7 +15,8 @@
  * @author hanl
  * @date 04/07/2015
  */
-public class PublicCollection implements RewriteTask.RewriteNodeAt {
+public class PublicCollection
+        implements RewriteTask.RewriteNodeAt {
 
     public PublicCollection() {
         super();
@@ -59,4 +61,5 @@
     public String at() {
         return "/collection";
     }
+
 }
diff --git a/src/main/java/de/ids_mannheim/korap/resource/rewrite/RewriteHandler.java b/src/main/java/de/ids_mannheim/korap/resource/rewrite/RewriteHandler.java
index b6f7785..90bebd4 100644
--- a/src/main/java/de/ids_mannheim/korap/resource/rewrite/RewriteHandler.java
+++ b/src/main/java/de/ids_mannheim/korap/resource/rewrite/RewriteHandler.java
@@ -1,6 +1,8 @@
 package de.ids_mannheim.korap.resource.rewrite;
 
 import com.fasterxml.jackson.databind.JsonNode;
+import de.ids_mannheim.korap.config.BeanInjectable;
+import de.ids_mannheim.korap.config.ContextHolder;
 import de.ids_mannheim.korap.config.KustvaktConfiguration;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.user.User;
@@ -18,7 +20,7 @@
  */
 // todo: do post processing!
 //todo: load rewritenode and rewritequery automatically from classpath by default, but namespaced from package
-public class RewriteHandler {
+public class RewriteHandler implements BeanInjectable {
 
     private static Logger jlog = LoggerFactory.getLogger(RewriteHandler.class);
     private Collection<RewriteTask.IterableRewriteAt> node_processors;
@@ -26,15 +28,33 @@
     private Collection<RewriteTask> query_processors;
 
     private Set<Class> failed_task_registration;
-
     private KustvaktConfiguration config;
+    private ContextHolder beans;
 
     public RewriteHandler(KustvaktConfiguration config) {
+        this();
         this.config = config;
+    }
+
+    public RewriteHandler() {
         this.node_processors = new HashSet<>();
         this.token_node_processors = new HashSet<>();
         this.query_processors = new HashSet<>();
         this.failed_task_registration = new HashSet<>();
+        this.beans = null;
+    }
+
+
+    public void defaultRewriteConstraints() {
+        this.add(FoundryInject.class);
+        this.add(PublicCollection.class);
+        this.add(IdWriter.class);
+        this.add(DocMatchRewrite.class);
+        this.add(CollectionCleanupFilter.class);
+    }
+
+    public Set getFailedProcessors() {
+        return this.failed_task_registration;
     }
 
     public boolean addProcessor(RewriteTask rewriter) {
@@ -123,12 +143,14 @@
 
     private JsonNode process(JsonNode root, User user, boolean post) {
         jlog.debug("Running rewrite process on query {}", root);
-        Iterator<Map.Entry<String, JsonNode>> it = root.fields();
-        while (it.hasNext()) {
-            Map.Entry<String, JsonNode> next = it.next();
-            process(next.getKey(), next.getValue(), user, post);
+        if (root!= null) {
+            Iterator<Map.Entry<String, JsonNode>> it = root.fields();
+            while (it.hasNext()) {
+                Map.Entry<String, JsonNode> next = it.next();
+                process(next.getKey(), next.getValue(), user, post);
+            }
+            processFixedNode(root, user, this.query_processors, post);
         }
-        processFixedNode(root, user, this.query_processors, post);
         return root;
     }
 
@@ -157,10 +179,17 @@
     // todo: integrate notifications into system!
     private boolean processNode(String rootNode, KoralNode node, User user,
             Collection<? extends RewriteTask> tasks, boolean post) {
+        if (this.config == null)
+            throw new RuntimeException(
+                    "KustvaktConfiguration must be set!");
+
         for (RewriteTask task : tasks) {
             jlog.debug("running processor on node: " + node);
             jlog.debug("on processor: " + task.getClass().toString());
 
+            if (this.beans != null && task instanceof BeanInjectable)
+                ((BeanInjectable) task).insertBeans(this.beans);
+
             if (task instanceof RewriteTask.IterableRewriteAt) {
                 RewriteTask.IterableRewriteAt rw = (RewriteTask.IterableRewriteAt) task;
                 if (rw.path() != null && !rw.path().equals(rootNode)) {
@@ -212,4 +241,9 @@
         }
     }
 
+    @Override
+    public <T extends ContextHolder> void insertBeans(T beans) {
+        this.beans = beans;
+        this.config = beans.getConfiguration();
+    }
 }
diff --git a/src/main/java/de/ids_mannheim/korap/resource/rewrite/RewriteTask.java b/src/main/java/de/ids_mannheim/korap/resource/rewrite/RewriteTask.java
index 8166961..308f524 100644
--- a/src/main/java/de/ids_mannheim/korap/resource/rewrite/RewriteTask.java
+++ b/src/main/java/de/ids_mannheim/korap/resource/rewrite/RewriteTask.java
@@ -20,6 +20,7 @@
          */
         JsonNode preProcess(KoralNode node, KustvaktConfiguration config,
                 User user) throws KustvaktException;
+
     }
 
     /**
diff --git a/src/main/java/de/ids_mannheim/korap/resource/rewrite/TreeConstraint.java b/src/main/java/de/ids_mannheim/korap/resource/rewrite/TreeConstraint.java
index 2e56999..d569223 100644
--- a/src/main/java/de/ids_mannheim/korap/resource/rewrite/TreeConstraint.java
+++ b/src/main/java/de/ids_mannheim/korap/resource/rewrite/TreeConstraint.java
@@ -1,6 +1,7 @@
 package de.ids_mannheim.korap.resource.rewrite;
 
 import com.fasterxml.jackson.databind.JsonNode;
+import de.ids_mannheim.korap.config.BeanInjectable;
 import de.ids_mannheim.korap.config.KustvaktConfiguration;
 import de.ids_mannheim.korap.user.User;
 
@@ -42,7 +43,8 @@
  * @author hanl
  * @date 02/07/2015
  */
-public class TreeConstraint implements RewriteTask.RewriteNodeAt {
+public class TreeConstraint
+        implements RewriteTask.RewriteNodeAt {
 
     private String pointer;
 
diff --git a/src/main/java/de/ids_mannheim/korap/resources/Corpus.java b/src/main/java/de/ids_mannheim/korap/resources/Corpus.java
old mode 100755
new mode 100644
diff --git a/src/main/java/de/ids_mannheim/korap/resources/Permissions.java b/src/main/java/de/ids_mannheim/korap/resources/Permissions.java
index c6fc6ec..0cdb37e 100644
--- a/src/main/java/de/ids_mannheim/korap/resources/Permissions.java
+++ b/src/main/java/de/ids_mannheim/korap/resources/Permissions.java
@@ -10,23 +10,22 @@
 
         //fixme: add read_policy permission to allow read policy permissions
         READ(Permissions.READ),
-
         WRITE(Permissions.WRITE),
+        DELETE(Permissions.DELETE),
 
-        DELETE(Permissions.READ),
         READ_POLICY(Permissions.READ_POLICY),
         CREATE_POLICY(Permissions.CREATE_POLICY),
         MODIFY_POLICY(Permissions.MODIFY_POLICY),
         DELETE_POLICY(Permissions.DELETE_POLICY),
         ALL(Permissions.ALL);
 
-        private final Byte b;
+        private final byte b;
 
-        Permission(Byte b) {
+        Permission(byte b) {
             this.b = b;
         }
 
-        public Byte toByte() {
+        public byte toByte() {
             return this.b;
         }
     }
@@ -40,28 +39,4 @@
     private static final byte DELETE_POLICY = 64;
     private static final byte ALL = 127;
 
-    @Deprecated
-    public static Byte getByte(Permission perm) {
-        switch (perm) {
-            case READ:
-                return READ;
-            case WRITE:
-                return WRITE;
-            case DELETE:
-                return DELETE;
-            case READ_POLICY:
-                return READ_POLICY;
-            case DELETE_POLICY:
-                return DELETE_POLICY;
-            case MODIFY_POLICY:
-                return MODIFY_POLICY;
-            case CREATE_POLICY:
-                return CREATE_POLICY;
-            case ALL:
-                return ALL;
-            default:
-                return 0;
-        }
-    }
-
-}
+}
\ No newline at end of file
diff --git a/src/main/java/de/ids_mannheim/korap/resources/ResourceFactory.java b/src/main/java/de/ids_mannheim/korap/resources/ResourceFactory.java
old mode 100755
new mode 100644
index 231017b..48e4747
--- a/src/main/java/de/ids_mannheim/korap/resources/ResourceFactory.java
+++ b/src/main/java/de/ids_mannheim/korap/resources/ResourceFactory.java
@@ -28,7 +28,7 @@
         try {
             return (KustvaktResource) clazz.newInstance();
         }catch (InstantiationException | IllegalAccessException e) {
-            e.printStackTrace();
+            // do nothing
         }
         return null;
     }
diff --git a/src/main/java/de/ids_mannheim/korap/resources/VirtualCollection.java b/src/main/java/de/ids_mannheim/korap/resources/VirtualCollection.java
old mode 100755
new mode 100644
diff --git a/src/main/java/de/ids_mannheim/korap/security/Parameter.java b/src/main/java/de/ids_mannheim/korap/security/Parameter.java
index 88f433e..5f775ad 100644
--- a/src/main/java/de/ids_mannheim/korap/security/Parameter.java
+++ b/src/main/java/de/ids_mannheim/korap/security/Parameter.java
@@ -6,9 +6,8 @@
 
 /**
  * @author hanl@ids-mannheim.de
- * @date 09/11/13
+ * @date 09/11/14
  */
-//todo:
 @Getter
 public class Parameter extends KustvaktResource {
 
diff --git a/src/main/java/de/ids_mannheim/korap/security/PermissionsBuffer.java b/src/main/java/de/ids_mannheim/korap/security/PermissionsBuffer.java
index 96f1e72..9c63a15 100644
--- a/src/main/java/de/ids_mannheim/korap/security/PermissionsBuffer.java
+++ b/src/main/java/de/ids_mannheim/korap/security/PermissionsBuffer.java
@@ -34,7 +34,7 @@
     }
 
     public boolean containsPermission(Permissions.Permission p) {
-        return containsPByte(Permissions.getByte(p));
+        return containsPByte(p.toByte());
     }
 
     public boolean containsPByte(byte perm) {
@@ -44,7 +44,7 @@
     public int addPermission(int b) {
         short r = (short) (bytes[1] & b);
         if ((bytes[1] & b) != b)
-            bytes[1] += (b - r);
+            bytes[1] += b;
         else
             return -1;
         return 0;
@@ -121,6 +121,10 @@
         return b.getShort();
     }
 
+    public byte[] getByteArray() {
+        return bytes;
+    }
+
     public Byte getPbyte() {
         return this.bytes[1];
     }
@@ -131,18 +135,6 @@
             if (containsPByte(p.toByte()))
                 pe.add(p);
         }
-        //        if (containsPByte(Permissions.READ))
-        //            pe.add(Permissions.Permission.READ);
-        //        if (containsPByte(Permissions.WRITE))
-        //            pe.add(Permissions.Permission.WRITE);
-        //        if (containsPByte(Permissions.DELETE))
-        //            pe.add(Permissions.Permission.DELETE);
-        //        if (containsPByte(Permissions.CREATE_POLICY))
-        //            pe.add(Permissions.Permission.CREATE_POLICY);
-        //        if (containsPByte(Permissions.MODIFY_POLICY))
-        //            pe.add(Permissions.Permission.MODIFY_POLICY);
-        //        if (containsPByte(Permissions.DELETE_POLICY))
-        //            pe.add(Permissions.Permission.DELETE_POLICY);
         return pe;
     }
 
diff --git a/src/main/java/de/ids_mannheim/korap/security/SecurityPolicy.java b/src/main/java/de/ids_mannheim/korap/security/SecurityPolicy.java
index dfaece7..9539cb8 100644
--- a/src/main/java/de/ids_mannheim/korap/security/SecurityPolicy.java
+++ b/src/main/java/de/ids_mannheim/korap/security/SecurityPolicy.java
@@ -22,6 +22,7 @@
     // a settingattribute id for instance,
     // which specifies the attribute to be protected by this policy
     private String target;
+    // todo: change to set!
     private List<PolicyCondition> conditions;
     private Set<Integer> removedidx;
     private Set<Integer> addedidx;
@@ -86,9 +87,9 @@
 
     // todo ???????
     @Deprecated
-    public SecurityPolicy setOverride(Permissions.Permission... perms) {
+    private SecurityPolicy setOverride(Permissions.Permission... perms) {
         for (Permissions.Permission p : perms)
-            this.permissions.addOverride(Permissions.getByte(p));
+            this.permissions.addOverride(p.toByte());
         return this;
     }
 
@@ -155,11 +156,16 @@
         if (this.addedidx.contains(idx))
             this.addedidx.remove(idx);
         else
-            this.removedidx.add(this.conditions.indexOf(constraint));
+            this.removedidx.add(idx);
         return this;
     }
 
     public SecurityPolicy addCondition(PolicyCondition constraint) {
+        this.conditions.add(constraint);
+        return this;
+    }
+
+    public SecurityPolicy addNewCondition(PolicyCondition constraint) {
         if (this.conditions.add(constraint))
             this.addedidx.add(this.conditions.indexOf(constraint));
         return this;
diff --git a/src/main/java/de/ids_mannheim/korap/security/ac/PolicyBuilder.java b/src/main/java/de/ids_mannheim/korap/security/ac/PolicyBuilder.java
index 7e65b7c..8fff53c 100644
--- a/src/main/java/de/ids_mannheim/korap/security/ac/PolicyBuilder.java
+++ b/src/main/java/de/ids_mannheim/korap/security/ac/PolicyBuilder.java
@@ -151,7 +151,7 @@
                 }else if (rel.equals(Relation.OR)) {
                     for (PolicyCondition c : this.conditions) {
                         SecurityPolicy policy = new SecurityPolicy()
-                                .addCondition(c).setTarget(resources[idx])
+                                .addNewCondition(c).setTarget(resources[idx])
                                 .addPermission(permissions)
                                 .setCreator(this.user.getId());
 
diff --git a/src/main/java/de/ids_mannheim/korap/security/ac/PolicyDao.java b/src/main/java/de/ids_mannheim/korap/security/ac/PolicyDao.java
index 75d2e8a..57d4658 100644
--- a/src/main/java/de/ids_mannheim/korap/security/ac/PolicyDao.java
+++ b/src/main/java/de/ids_mannheim/korap/security/ac/PolicyDao.java
@@ -79,10 +79,10 @@
         MapSqlParameterSource np = new MapSqlParameterSource();
         np.addValue("target", policy.getTarget());
         if (policy.getContext().getEnd() != 0L)
-            np.addValue("exp", new Timestamp(policy.getContext().getEnd()));
+            np.addValue("exp", policy.getContext().getEnd());
         else
             np.addValue("exp", null);
-        np.addValue("en", new Timestamp(policy.getContext().getStart()));
+        np.addValue("en", policy.getContext().getStart());
         np.addValue("posix", policy.getPermissionByte());
         np.addValue("cr", new Timestamp(TimeUtils.getNow().getMillis()));
         np.addValue("creator", user.getId());
@@ -95,6 +95,7 @@
             this.mapConstraints(policy);
             return policy.getID();
         }catch (DataAccessException e) {
+            e.printStackTrace();
             jlog.error("Operation (INSERT) not possible for '{}' for user '{}'",
                     policy.toString(), user.getId());
             throw new dbException(user.getId(), "policy_store",
@@ -146,6 +147,7 @@
             }
             policy.clear();
         }catch (DataAccessException e) {
+            e.printStackTrace();
             jlog.error(
                     "Operation (MAPPING POLICY CONDITIONS) not possible for '{}' for user '{}'",
                     policy.toString(), policy.getCreator());
@@ -249,7 +251,6 @@
         param.addValue("perm", perm);
         param.addValue("type", ResourceFactory.getResourceMapping(clazz));
         param.addValue("en", new Timestamp(TimeUtils.getNow().getMillis()));
-
         String sql_new = "select pv.*, pv.perm & :perm as allowed, " +
                 "rh.depth, (select max(depth) from resource_tree " +
                 "where child_id=rh.child_id) as max_depth from policy_view as pv "
@@ -258,7 +259,7 @@
                 "where " +
                 "pv.enable <= :en and (pv.expire > :en or pv.expire is NULL) and "
                 +
-                "pv.group_id=:cond and pv.typeand " +
+                "pv.group_id=:cond and pv.type=:type and " +
                 "(select sum(distinct depth) from resource_tree where child_id=rh.child_id) = "
                 +
                 "(select sum(distinct res.depth) from policy_view as pos inner join resource_tree as res on res.parent_id=pos.id where (pos.group_id=:cond)"
@@ -276,8 +277,7 @@
                         }
                     });
         }catch (DataAccessException e) {
-            e.printStackTrace();
-            jlog.error("Permission Denied for policy retrieval for '{}'",
+            jlog.error("Permission Denied: policy retrieval for '{}'",
                     condition.getSpecifier());
             return Collections.emptyList();
         }
@@ -308,7 +308,6 @@
                 "(select sum(distinct res.depth) from policy_view as pos inner join resource_tree as res on res.parent_id=pos.id where (pos.group_id in (select g.group_id from group_users "
                 +
                 "as g where g.user_id=:userid) or pos.group_id='self') and res.child_id=rh.child_id group by child_id)";
-
         try {
             return this.jdbcTemplate.query(sql_new, param,
                     new ResultSetExtractor<List<SecurityPolicy>[]>() {
@@ -316,12 +315,14 @@
                         @Override
                         public List<SecurityPolicy>[] extractData(ResultSet rs)
                                 throws SQLException, DataAccessException {
-                            return SecurityRowMappers.mapResourcePolicies(rs);
+                            List<SecurityPolicy>[] pol = SecurityRowMappers
+                                    .mapResourcePolicies(rs);
+                            return pol;
                         }
                     });
         }catch (DataAccessException e) {
             jlog.error(
-                    "Permission Denied for policy retrieval for '{}' for user '{}'",
+                    "Permission Denied: policy retrieval for '{}' for user '{}'",
                     target, user.getId());
             return new List[2];
         }
diff --git a/src/main/java/de/ids_mannheim/korap/security/ac/ResourceFinder.java b/src/main/java/de/ids_mannheim/korap/security/ac/ResourceFinder.java
old mode 100755
new mode 100644
index bc3bcb4..232c5eb
--- a/src/main/java/de/ids_mannheim/korap/security/ac/ResourceFinder.java
+++ b/src/main/java/de/ids_mannheim/korap/security/ac/ResourceFinder.java
@@ -1,6 +1,7 @@
 package de.ids_mannheim.korap.security.ac;
 
-import de.ids_mannheim.korap.config.BeanConfiguration;
+import de.ids_mannheim.korap.config.ContextHolder;
+import de.ids_mannheim.korap.config.BeansFactory;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.interfaces.db.PolicyHandlerIface;
 import de.ids_mannheim.korap.interfaces.db.ResourceOperationIface;
@@ -12,6 +13,7 @@
 import de.ids_mannheim.korap.security.SecurityPolicy;
 import de.ids_mannheim.korap.user.Attributes;
 import de.ids_mannheim.korap.user.User;
+import lombok.NonNull;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -20,12 +22,13 @@
 /**
  * Created by hanl on 3/20/14.
  */
+//todo: use factory pattern to init resourcefinder
 public class ResourceFinder {
 
     private static final Logger jlog = LoggerFactory
             .getLogger(ResourceFinder.class);
     private static PolicyHandlerIface policydao;
-    private static ResourceOperationIface resourcedao;
+    private static Map<Class, ResourceOperationIface> resourcedaos = new HashMap<>();
 
     private List<KustvaktResource.Container> containers;
     private User user;
@@ -37,17 +40,18 @@
 
     private ResourceFinder() {
         this.containers = new ArrayList<>();
-        checkProviders();
+        overrideProviders(null);
     }
 
-    private static void checkProviders() {
-        if (BeanConfiguration.hasContext() && policydao == null) {
-            ResourceFinder.policydao = BeanConfiguration.getBeans()
-                    .getPolicyDbProvider();
-            ResourceFinder.resourcedao = BeanConfiguration.getBeans()
-                    .getResourceProvider();
+    public static void overrideProviders(ContextHolder beans) {
+        if (beans == null)
+            beans = BeansFactory.getKustvaktContext();
+        if (policydao == null | resourcedaos == null) {
+            ResourceFinder.policydao = beans.getPolicyDbProvider();
+            for (ResourceOperationIface iface : beans.getResourceProvider())
+                resourcedaos.put(iface.type(), iface);
         }
-        if (policydao == null | resourcedao == null)
+        if (policydao == null | resourcedaos.isEmpty())
             throw new RuntimeException("provider not set!");
     }
 
@@ -71,8 +75,8 @@
     }
 
     //todo: needs to be much faster!
-    public static <T extends KustvaktResource> ResourceFinder init(User user,
-            Class<T> clazz) throws KustvaktException {
+    public static <T extends KustvaktResource> ResourceFinder init(
+            @NonNull User user, Class<T> clazz) throws KustvaktException {
         return init(null, true, user, clazz, Permissions.Permission.READ);
     }
 
@@ -85,15 +89,25 @@
 
     public static <T extends KustvaktResource> Set<T> searchPublic(
             Class<T> clazz) throws KustvaktException {
-        checkProviders();
+        return searchPublicFiltered(clazz);
+    }
+
+    public static <T extends KustvaktResource> Set<T> searchPublicFiltered(
+            Class<T> clazz, String ...ids) throws KustvaktException {
+        overrideProviders(null);
         Set<T> sets = new HashSet<>();
         List<SecurityPolicy> policies = policydao
                 .getPolicies(new PolicyCondition(Attributes.PUBLIC_GROUP),
                         clazz, Permissions.Permission.READ.toByte());
 
-        for (SecurityPolicy policy : policies)
-            sets.add((T) resourcedao.findbyId(policy.getTarget(),
-                    User.UserFactory.getDemoUser()));
+        List<String> id_set = Arrays.asList(ids);
+        for (SecurityPolicy policy : policies) {
+            T r = (T) resourcedaos.get(KustvaktResource.class)
+                    .findbyId(policy.getTarget(),
+                            User.UserFactory.getDemoUser());
+            if (id_set.isEmpty() || id_set.contains(r.getPersistentID()))
+                sets.add(r);
+        }
         return sets;
     }
 
@@ -123,10 +137,8 @@
         Set<T> resources = new HashSet<>();
         if (this.containers != null) {
             for (KustvaktResource.Container c : this.containers) {
-                ResourceOperationIface<T> iface = BeanConfiguration.getBeans()
-                        .getResourceProvider();
                 try {
-                    T resource = (T) iface
+                    T resource = (T) resourcedaos.get(KustvaktResource.class)
                             .findbyId(c.getPersistentID(), this.user);
                     if (resource != null) {
                         PolicyEvaluator e = PolicyEvaluator
diff --git a/src/main/java/de/ids_mannheim/korap/security/ac/ResourceHandler.java b/src/main/java/de/ids_mannheim/korap/security/ac/ResourceHandler.java
index 7510e23..840461b 100644
--- a/src/main/java/de/ids_mannheim/korap/security/ac/ResourceHandler.java
+++ b/src/main/java/de/ids_mannheim/korap/security/ac/ResourceHandler.java
@@ -20,6 +20,8 @@
  * @date 23/03/2014
  */
 
+//todo: use interface (maybe a cachable interface?) and bean instanceing
+// todo: if cachable, data integrity needs to be checked! either remove caching or check integrity!
 @SuppressWarnings("all")
 public class ResourceHandler {
 
@@ -56,7 +58,7 @@
         try {
             p = SecurityManager.findbyId(id, user);
         } catch (EmptyResultException e) {
-            throw new NotAuthorizedException(StatusCodes.PERMISSION_DENIED);
+            throw new NotAuthorizedException(StatusCodes.EMPTY_RESULTS, String.valueOf(id));
         }
         return p.getResource();
     }
@@ -64,22 +66,17 @@
     public <T extends KustvaktResource> T findbyStrId(String persistent_id,
             User user, String type)
             throws KustvaktException, NotAuthorizedException {
-        T cache = (T) getCache(persistent_id, ResourceFactory
-                .getResourceClass(type));
-        if (cache != null)
-            return cache;
-        else
-            return (T) findbyStrId(persistent_id, user,
-                    ResourceFactory.getResourceClass(type));
+        return (T) findbyStrId(persistent_id, user,
+                ResourceFactory.getResourceClass(type));
     }
 
     public <T extends KustvaktResource> T findbyStrId(String persistent_id,
             User user, Class<T> type)
             throws KustvaktException, NotAuthorizedException {
-        T cache = (T) getCache(persistent_id, type);
-        if (cache != null)
-            return cache;
-        else {
+        //T cache = (T) getCache(persistent_id, type);
+        //if (cache != null)
+        //    return cache;
+        //else {
             SecurityManager<T> p;
             try {
                 p = SecurityManager.findbyId(persistent_id, user, type);
@@ -87,7 +84,7 @@
                 throw new NotAuthorizedException(StatusCodes.EMPTY_RESULTS, persistent_id);
             }
             return p.getResource();
-        }
+        //}
     }
 
     public <T extends KustvaktResource> Collection<T> findbyPath(String path, Class type, User user)
@@ -136,14 +133,14 @@
     public <T extends KustvaktResource> void deleteResources(User user, T... resources)
             throws KustvaktException, NotAuthorizedException {
         for (T r : resources) {
-            SecurityManager policies;
+            SecurityManager manager;
             try {
-                policies = SecurityManager.findbyId(r.getPersistentID(), user, r.getClass(),
+                manager = SecurityManager.findbyId(r.getPersistentID(), user, r.getClass(),
                         Permissions.Permission.DELETE);
             } catch (EmptyResultException e) {
                 return;
             }
-            policies.deleteResource();
+            manager.deleteResource();
         }
     }
 
diff --git a/src/main/java/de/ids_mannheim/korap/security/ac/SecurityManager.java b/src/main/java/de/ids_mannheim/korap/security/ac/SecurityManager.java
index b05d810..b66fe62 100644
--- a/src/main/java/de/ids_mannheim/korap/security/ac/SecurityManager.java
+++ b/src/main/java/de/ids_mannheim/korap/security/ac/SecurityManager.java
@@ -1,6 +1,7 @@
 package de.ids_mannheim.korap.security.ac;
 
-import de.ids_mannheim.korap.config.BeanConfiguration;
+import de.ids_mannheim.korap.config.ContextHolder;
+import de.ids_mannheim.korap.config.BeansFactory;
 import de.ids_mannheim.korap.exceptions.EmptyResultException;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.exceptions.NotAuthorizedException;
@@ -54,20 +55,20 @@
         this.policies[0] = new ArrayList<>();
         this.silent = true;
         this.user = user;
-        checkProviders();
+        overrideProviders(null);
     }
 
-    private static void checkProviders() {
-        if (BeanConfiguration.hasContext() && (policydao == null
-                | crypto == null)) {
-            SecurityManager.policydao = BeanConfiguration.getBeans()
-                    .getPolicyDbProvider();
-            SecurityManager.crypto = BeanConfiguration.getBeans()
-                    .getEncryption();
+    public static void overrideProviders(ContextHolder beans) {
+        if (beans == null)
+            beans = BeansFactory.getKustvaktContext();
+        if (policydao == null | crypto == null) {
+            SecurityManager.policydao = beans.getPolicyDbProvider();
+            SecurityManager.crypto = beans.getEncryption();
             SecurityManager.handlers = new HashMap<>();
-            ResourceOperationIface rprovider = BeanConfiguration.getBeans()
+            Collection<ResourceOperationIface> providers = beans
                     .getResourceProvider();
-            SecurityManager.handlers.put(rprovider.type(), rprovider);
+            for (ResourceOperationIface op : providers)
+                SecurityManager.handlers.put(op.type(), op);
         }
         if (policydao == null && crypto == null)
             throw new RuntimeException("providers not set!");
@@ -214,9 +215,6 @@
         if (id instanceof Integer)
             this.policies = policydao
                     .getPolicies((Integer) id, this.user, b.getPbyte());
-        //        System.out.println("-------------------------------");
-        //        System.out.println("LENGTH OF POLICY ARRAY " + this.policies.length);
-        //        System.out.println("POLICY AT 0 " + this.policies[0]);
         this.evaluator = new PolicyEvaluator(this.user, this.policies);
 
         if (this.policies == null) {
@@ -242,7 +240,8 @@
             iface = handlers.get(KustvaktResource.class);
         T resource = (T) iface
                 .findbyId(this.evaluator.getResourceID(), this.user);
-        // todo: fix this
+        // fixme: this
+        // fixme: deprecated!
         resource.setManaged(this.evaluator.isManaged());
         resource.setShared(this.evaluator.isShared());
         return resource;
@@ -257,7 +256,7 @@
     public static SecurityManager register(KustvaktResource resource, User user)
             throws KustvaktException, NotAuthorizedException {
         SecurityManager p = new SecurityManager(user);
-        if (!user.isDemo()) {
+        if (!User.UserFactory.isDemo(user.getUsername())) {
             if (resource.getParentID() != null) {
                 try {
                     // the owner has all rights per default, in order to be able derivate from a parent resource, he needs all permissions as well
@@ -408,6 +407,7 @@
         }
     }
 
+    // todo:
     public void deletePolicy(SecurityPolicy policy)
             throws KustvaktException, NotAuthorizedException {
         // todo: get rid of this: use sql to match policy id and target according to evaluator!
@@ -492,5 +492,4 @@
             return false;
         }
     }
-
 }
diff --git a/src/main/java/de/ids_mannheim/korap/security/ac/SecurityRowMappers.java b/src/main/java/de/ids_mannheim/korap/security/ac/SecurityRowMappers.java
index efcc95c..0ab9cbd 100644
--- a/src/main/java/de/ids_mannheim/korap/security/ac/SecurityRowMappers.java
+++ b/src/main/java/de/ids_mannheim/korap/security/ac/SecurityRowMappers.java
@@ -26,9 +26,10 @@
         @Override
         public SecurityPolicy mapRow(ResultSet rs, int rowNum)
                 throws SQLException {
+            String perms = rs.getString("perm");
             SecurityPolicy p = new SecurityPolicy();
             p.setID(rs.getInt("pid")).setTarget(rs.getString("persistent_id"))
-                    .setPOSIX(rs.getString("perm"));
+                    .setPOSIX(perms);
 
             PolicyContext context = new PolicyContext();
             context.setIPMask(rs.getString("iprange"));
@@ -70,14 +71,16 @@
         }
     }
 
+    @SuppressWarnings(value = "all")
     public static List<SecurityPolicy>[] mapResourcePolicies(ResultSet rs)
             throws SQLException {
         List<SecurityPolicy>[] policyArray = null;
         List<Integer>[] idx = null;
+        loop:
         while (rs.next()) {
-            // user has no permission here --> thus skip
+            // user has no permission here, thus skip
             if (rs.getInt("allowed") == 0)
-                continue;
+                continue loop;
 
             if (policyArray == null) {
                 int v = rs.getInt("max_depth") + 1;
@@ -86,7 +89,6 @@
             }
 
             int depth = rs.getInt("depth");
-
             if (policyArray[depth] == null) {
                 policyArray[depth] = new ArrayList<>();
                 idx[depth] = new ArrayList<>();
@@ -142,7 +144,7 @@
             PolicyCondition c = new PolicyCondition(rs.getString("group_id"));
 
             if (!policy.contains(c))
-                policy.addCondition(c);
+                policy.addNewCondition(c);
         }
         return new ArrayList<>(policyMap.values());
     }
@@ -172,7 +174,7 @@
             PolicyCondition c = new PolicyCondition(rs.getString("group_id"));
 
             if (!policy.contains(c))
-                policy.addCondition(c);
+                policy.addNewCondition(c);
         }
 
         List<SecurityPolicy>[] results;
diff --git a/src/main/java/de/ids_mannheim/korap/security/auth/BasicHttpAuth.java b/src/main/java/de/ids_mannheim/korap/security/auth/BasicHttpAuth.java
index aa7b28b..c93d6ec 100644
--- a/src/main/java/de/ids_mannheim/korap/security/auth/BasicHttpAuth.java
+++ b/src/main/java/de/ids_mannheim/korap/security/auth/BasicHttpAuth.java
@@ -1,6 +1,6 @@
 package de.ids_mannheim.korap.security.auth;
 
-import de.ids_mannheim.korap.config.BeanConfiguration;
+import de.ids_mannheim.korap.config.BeansFactory;
 import de.ids_mannheim.korap.config.Scopes;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.exceptions.StatusCodes;
@@ -47,8 +47,8 @@
     @Override
     public TokenContext getUserStatus(String authToken)
             throws KustvaktException {
-        EncryptionIface crypto = BeanConfiguration.getBeans().getEncryption();
-        EntityHandlerIface dao = BeanConfiguration.getBeans()
+        EncryptionIface crypto = BeansFactory.getKustvaktContext().getEncryption();
+        EntityHandlerIface dao = BeansFactory.getKustvaktContext()
                 .getUserDBHandler();
         String[] values = decode(authToken);
         if (values != null) {
diff --git a/src/main/java/de/ids_mannheim/korap/security/auth/KustvaktAuthenticationManager.java b/src/main/java/de/ids_mannheim/korap/security/auth/KustvaktAuthenticationManager.java
index 29c3641..fe33683 100644
--- a/src/main/java/de/ids_mannheim/korap/security/auth/KustvaktAuthenticationManager.java
+++ b/src/main/java/de/ids_mannheim/korap/security/auth/KustvaktAuthenticationManager.java
@@ -1,6 +1,7 @@
 package de.ids_mannheim.korap.security.auth;
 
 import de.ids_mannheim.korap.auditing.AuditRecord;
+import de.ids_mannheim.korap.config.BeansFactory;
 import de.ids_mannheim.korap.config.KustvaktConfiguration;
 import de.ids_mannheim.korap.config.URIParam;
 import de.ids_mannheim.korap.exceptions.*;
@@ -23,6 +24,7 @@
 
 import java.io.UnsupportedEncodingException;
 import java.security.NoSuchAlgorithmException;
+import java.util.Collection;
 import java.util.Map;
 
 /**
@@ -40,18 +42,20 @@
     private EntityHandlerIface entHandler;
     private AuditingIface auditing;
     private KustvaktConfiguration config;
-    private final LoginCounter counter;
+    private Collection userdatadaos;
+    private LoginCounter counter;
     private Cache user_cache;
 
     public KustvaktAuthenticationManager(EntityHandlerIface userdb,
             EncryptionIface crypto, KustvaktConfiguration config,
-            AuditingIface auditer) {
+            AuditingIface auditer, Collection<UserDataDbIface> userdatadaos) {
+        this.user_cache = CacheManager.getInstance().getCache("users");
         this.entHandler = userdb;
         this.config = config;
         this.crypto = crypto;
         this.auditing = auditer;
         this.counter = new LoginCounter(config);
-        this.user_cache = CacheManager.getInstance().getCache("users");
+        this.userdatadaos = userdatadaos;
     }
 
     /**
@@ -485,8 +489,11 @@
         }
 
         KorAPUser user = User.UserFactory.getUser(username);
-        user.setAccountLocked(confirmation_required);
+        Object id = attributes.get(Attributes.ID);
+        if (id != null && id instanceof Integer)
+            user.setId((Integer) id);
 
+        user.setAccountLocked(confirmation_required);
         if (confirmation_required) {
             URIParam param = new URIParam(crypto.createToken(),
                     TimeUtils.plusSeconds(config.getExpiration()).getMillis());
@@ -505,10 +512,15 @@
             settings.readDefaults(safeMap);
             settings.checkRequired();
 
-            UserdataFactory.getDaoInstance(UserDetails.class).store(details);
-            UserdataFactory.getDaoInstance(UserSettings.class).store(settings);
+            UserDataDbIface dao = BeansFactory.getTypeFactory()
+                    .getTypedBean(userdatadaos, UserDetails.class);
+            assert dao != null;
+            dao.store(details);
+            dao = BeansFactory.getTypeFactory()
+                    .getTypedBean(userdatadaos, UserSettings.class);
+            assert dao != null;
+            dao.store(settings);
         }catch (KustvaktException e) {
-            e.printStackTrace();
             throw new WrappedException(e, StatusCodes.CREATE_ACCOUNT_FAILED,
                     user.toString());
         }
@@ -538,12 +550,19 @@
         d.readDefaults(attributes);
         d.checkRequired();
 
-        UserdataFactory.getDaoInstance(d.getClass()).store(d);
+        UserDataDbIface dao = BeansFactory.getTypeFactory()
+                .getTypedBean(userdatadaos, UserDetails.class);
+        assert dao != null;
+        dao.store(d);
 
         UserSettings s = new UserSettings(user.getId());
         s.readDefaults(attributes);
         s.checkRequired();
-        UserdataFactory.getDaoInstance(s.getClass()).store(s);
+
+        dao = BeansFactory.getTypeFactory()
+                .getTypedBean(userdatadaos, UserSettings.class);
+        assert dao != null;
+        dao.store(d);
 
         return user;
     }
@@ -681,13 +700,16 @@
             throws WrappedException {
 
         try {
-            UserDataDbIface<T> dao = UserdataFactory.getDaoInstance(clazz);
-            T data = dao.get(user);
+            UserDataDbIface<T> dao = BeansFactory.getTypeFactory()
+                    .getTypedBean(BeansFactory.getKustvaktContext().getUserDataDaos(), clazz);
+            T data = null;
+            if (dao != null)
+                data = dao.get(user);
+
             if (data == null)
                 throw new WrappedException(user.getId(),
-                        StatusCodes.EMPTY_RESULTS, clazz.getSimpleName());
-
-            return data;
+                            StatusCodes.EMPTY_RESULTS, clazz.getSimpleName());
+                return data;
         }catch (KustvaktException e) {
             jlog.error("Error ", e);
             throw new WrappedException(e, StatusCodes.GET_ACCOUNT_FAILED);
@@ -698,10 +720,12 @@
     @Override
     public void updateUserData(Userdata data) throws WrappedException {
         try {
+
             data.validate(this.crypto);
-            UserDataDbIface dao = UserdataFactory
-                    .getDaoInstance(data.getClass());
-            dao.update(data);
+            UserDataDbIface dao = BeansFactory.getTypeFactory()
+                    .getTypedBean(BeansFactory.getKustvaktContext().getUserDataDaos(), data.getClass());
+            if (dao != null)
+                dao.update(data);
         }catch (KustvaktException e) {
             jlog.error("Error ", e);
             throw new WrappedException(e, StatusCodes.UPDATE_ACCOUNT_FAILED);
diff --git a/src/main/java/de/ids_mannheim/korap/user/User.java b/src/main/java/de/ids_mannheim/korap/user/User.java
index e266f1f..8161254 100644
--- a/src/main/java/de/ids_mannheim/korap/user/User.java
+++ b/src/main/java/de/ids_mannheim/korap/user/User.java
@@ -123,10 +123,6 @@
         return true;
     }
 
-    public boolean isDemo() {
-        return this.getUsername().equalsIgnoreCase(DemoUser.DEMOUSER_NAME);
-    }
-
     public boolean isAdmin() {
         return this.getUsername().equals(ADMINISTRATOR_ID);
     }
diff --git a/src/main/java/de/ids_mannheim/korap/user/Userdata.java b/src/main/java/de/ids_mannheim/korap/user/Userdata.java
index 616857d..7b88f00 100644
--- a/src/main/java/de/ids_mannheim/korap/user/Userdata.java
+++ b/src/main/java/de/ids_mannheim/korap/user/Userdata.java
@@ -57,8 +57,11 @@
         return this.fields.get(key);
     }
 
+    /**
+     *
+     * @return
+     */
     public boolean isValid() {
-        //        return this.missing(this.fields).isEmpty() && this.userID != -1;
         return missing().length == 0;
     }
 
@@ -111,7 +114,7 @@
         return JsonUtils.toJSON(this.fields);
     }
 
-    public void addField(String key, Object value) {
+    public void setField(String key, Object value) {
         this.fields.put(key, value);
     }
 
diff --git a/src/main/java/de/ids_mannheim/korap/user/UserdataFactory.java b/src/main/java/de/ids_mannheim/korap/user/UserdataFactory.java
index 85e8046..3e899b2 100644
--- a/src/main/java/de/ids_mannheim/korap/user/UserdataFactory.java
+++ b/src/main/java/de/ids_mannheim/korap/user/UserdataFactory.java
@@ -1,6 +1,6 @@
 package de.ids_mannheim.korap.user;
 
-import de.ids_mannheim.korap.config.BeanConfiguration;
+import de.ids_mannheim.korap.config.BeansFactory;
 import de.ids_mannheim.korap.config.KustvaktClassLoader;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.exceptions.StatusCodes;
@@ -11,6 +11,7 @@
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.ParameterizedType;
 import java.lang.reflect.Type;
+import java.util.Collection;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Set;
@@ -19,6 +20,7 @@
  * @author hanl
  * @date 27/01/2016
  */
+@Deprecated
 public class UserdataFactory {
 
     private static final Map<Class<? extends Userdata>, UserDataDbIface> instances = new HashMap<>();
@@ -26,7 +28,23 @@
     private UserdataFactory() {
     }
 
-    public static Class<? extends UserDataDbIface> getClass(
+    public static UserDataDbIface getDaoInstanceFromBean(
+            Class<? extends Userdata> type) {
+        Collection<UserDataDbIface> daos = BeansFactory.getKustvaktContext()
+                .getUserDataDaos();
+        for (UserDataDbIface o : daos) {
+            Type gtype = o.getClass().getGenericInterfaces()[0];
+            if (gtype instanceof ParameterizedType) {
+                ParameterizedType ptype = (ParameterizedType) gtype;
+                Class ctype = (Class) ptype.getActualTypeArguments()[0];
+                if (ctype.equals(type))
+                    return o;
+            }
+        }
+        return null;
+    }
+
+    public static Class<? extends UserDataDbIface> getClassFromAnno(
             Class<? extends Userdata> data) {
         Set<Class<? extends UserDataDbIface>> c = KustvaktClassLoader
                 .loadSubTypes(UserDataDbIface.class);
@@ -42,15 +60,17 @@
         return null;
     }
 
-    public static UserDataDbIface getDaoInstance(
-            Class<? extends Userdata> data) throws KustvaktException {
+    // todo: remove and load userdata via bean context
+    @Deprecated
+    public static UserDataDbIface getDaoInstance(Class<? extends Userdata> data)
+            throws KustvaktException {
         if (instances.get(data) == null) {
-            Class<? extends UserDataDbIface> cl = getClass(data);
-            if (BeanConfiguration.hasContext() && cl != null) {
+            Class<? extends UserDataDbIface> cl = getClassFromAnno(data);
+            if (cl != null) {
                 try {
                     Constructor c = cl.getConstructor(PersistenceClient.class);
                     UserDataDbIface iface = (UserDataDbIface) c.newInstance(
-                            BeanConfiguration.getBeans()
+                            BeansFactory.getKustvaktContext()
                                     .getPersistenceClient());
                     instances.put(data, iface);
                     return iface;
@@ -59,7 +79,8 @@
                 }
             }
             throw new KustvaktException(StatusCodes.NOT_SUPPORTED,
-                    "No database handler found for type " + data.getSimpleName());
+                    "No database handler found for type " + data
+                            .getSimpleName());
         }else
             return instances.get(data);
     }
diff --git a/src/main/java/de/ids_mannheim/korap/utils/IPNetMask.java b/src/main/java/de/ids_mannheim/korap/utils/IPNetMask.java
old mode 100755
new mode 100644
diff --git a/src/main/java/de/ids_mannheim/korap/utils/PropertyReader.java b/src/main/java/de/ids_mannheim/korap/utils/PropertyReader.java
index 292b019..9d953b5 100644
--- a/src/main/java/de/ids_mannheim/korap/utils/PropertyReader.java
+++ b/src/main/java/de/ids_mannheim/korap/utils/PropertyReader.java
@@ -1,5 +1,7 @@
 package de.ids_mannheim.korap.utils;
 
+import de.ids_mannheim.korap.config.BeanInjectable;
+
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.IOException;
@@ -13,7 +15,6 @@
  */
 public abstract class PropertyReader {
 
-
     protected Map<String, Properties> read(String path) throws IOException {
         Map<String, Properties> res = new HashMap<>();
         Properties s = new Properties();
@@ -30,7 +31,6 @@
         return res;
     }
 
-
     public abstract void load();
 
 }
diff --git a/src/main/java/de/ids_mannheim/korap/utils/ServiceVersion.java b/src/main/java/de/ids_mannheim/korap/utils/ServiceVersion.java
deleted file mode 100755
index 1233c15..0000000
--- a/src/main/java/de/ids_mannheim/korap/utils/ServiceVersion.java
+++ /dev/null
@@ -1,33 +0,0 @@
-package de.ids_mannheim.korap.utils;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Properties;
-
-/**
- * @author hanl
- * @date 23/01/2014
- */
-public class ServiceVersion {
-
-    private ServiceVersion() {
-    }
-
-    public static String getAPIVersion() {
-        String path = "/version.prop";
-        InputStream stream = ServiceVersion.class.getResourceAsStream(path);
-        if (stream == null)
-            return "UNKNOWN";
-
-        Properties props = new Properties();
-        try {
-            props.load(stream);
-            stream.close();
-            return (String) props.get("version");
-        }catch (IOException e) {
-            return "UNKNOWN";
-        }
-
-    }
-
-}
diff --git a/src/main/java/de/ids_mannheim/korap/utils/UserPropertyReader.java b/src/main/java/de/ids_mannheim/korap/utils/UserPropertyReader.java
index 3369106..be187b7 100644
--- a/src/main/java/de/ids_mannheim/korap/utils/UserPropertyReader.java
+++ b/src/main/java/de/ids_mannheim/korap/utils/UserPropertyReader.java
@@ -1,10 +1,11 @@
 package de.ids_mannheim.korap.utils;
 
-import de.ids_mannheim.korap.config.BeanConfiguration;
+import de.ids_mannheim.korap.config.BeansFactory;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.exceptions.StatusCodes;
 import de.ids_mannheim.korap.interfaces.EncryptionIface;
 import de.ids_mannheim.korap.interfaces.db.EntityHandlerIface;
+import de.ids_mannheim.korap.interfaces.db.UserDataDbIface;
 import de.ids_mannheim.korap.user.*;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -31,8 +32,8 @@
 
     public UserPropertyReader(String path) {
         this.path = path;
-        this.iface = BeanConfiguration.getBeans().getUserDBHandler();
-        this.crypto = BeanConfiguration.getBeans().getEncryption();
+        this.iface = BeansFactory.getKustvaktContext().getUserDBHandler();
+        this.crypto = BeansFactory.getKustvaktContext().getEncryption();
     }
 
     @Override
@@ -100,13 +101,18 @@
             UserDetails det = new UserDetails(user.getId());
             det.readDefaults(vals);
             det.validate(crypto);
-            UserdataFactory.getDaoInstance(det.getClass()).store(det);
 
             Userdata set = new UserSettings(user.getId());
             set.readDefaults(vals);
             set.validate(crypto);
-            UserdataFactory.getDaoInstance(set.getClass()).store(set);
 
+            UserDataDbIface dao = BeansFactory.getTypeFactory()
+                    .getTypedBean(BeansFactory.getKustvaktContext().getUserDataDaos(), UserDetails.class);
+            dao.store(det);
+
+            dao = BeansFactory.getTypeFactory()
+                    .getTypedBean(BeansFactory.getKustvaktContext().getUserDataDaos(), UserSettings.class);
+            dao.store(set);
         }
 
         jlog.info("successfully created account for user {}",
diff --git a/src/main/java/de/ids_mannheim/korap/web/KustvaktBaseServer.java b/src/main/java/de/ids_mannheim/korap/web/KustvaktBaseServer.java
index 4934ac8..b3fdb51 100644
--- a/src/main/java/de/ids_mannheim/korap/web/KustvaktBaseServer.java
+++ b/src/main/java/de/ids_mannheim/korap/web/KustvaktBaseServer.java
@@ -3,12 +3,12 @@
 import com.sun.jersey.api.core.PackagesResourceConfig;
 import com.sun.jersey.api.core.ResourceConfig;
 import com.sun.jersey.spi.container.servlet.ServletContainer;
-import de.ids_mannheim.korap.config.BeanConfiguration;
+import de.ids_mannheim.korap.config.BeansFactory;
 import de.ids_mannheim.korap.config.KustvaktCacheManager;
 import de.ids_mannheim.korap.config.KustvaktClassLoader;
 import de.ids_mannheim.korap.config.KustvaktConfiguration;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
-import de.ids_mannheim.korap.web.service.BootupInterface;
+import de.ids_mannheim.korap.web.service.BootableBeanInterface;
 import lombok.Getter;
 import lombok.Setter;
 import org.eclipse.jetty.server.Connector;
@@ -35,9 +35,9 @@
         KustvaktArgs kargs = server.readAttributes(args);
 
         if (kargs.config != null)
-            BeanConfiguration.loadFileContext(kargs.config);
+            BeansFactory.loadFileContext(kargs.config);
         else
-            BeanConfiguration.loadClasspathContext();
+            BeansFactory.loadClasspathContext();
 
         KustvaktCacheManager.init();
 
@@ -60,9 +60,6 @@
                 case "--port":
                     kargs.setPort(Integer.valueOf(args[i + 1]));
                     break;
-                case "--props":
-                    kargs.setProperties(args[+1]);
-                    break;
                 case "--help":
                     StringBuffer b = new StringBuffer();
 
@@ -83,14 +80,14 @@
     }
 
     public void runPreStart() {
-        Set<Class<? extends BootupInterface>> set = KustvaktClassLoader
-                .loadSubTypes(BootupInterface.class);
+        Set<Class<? extends BootableBeanInterface>> set = KustvaktClassLoader
+                .loadSubTypes(BootableBeanInterface.class);
 
-        List<BootupInterface> list = new ArrayList<>(set.size());
+        List<BootableBeanInterface> list = new ArrayList<>(set.size());
         for (Class cl : set) {
-            BootupInterface iface;
+            BootableBeanInterface iface;
             try {
-                iface = (BootupInterface) cl.newInstance();
+                iface = (BootableBeanInterface) cl.newInstance();
                 list.add(iface);
             }catch (InstantiationException | IllegalAccessException e) {
                 continue;
@@ -99,10 +96,9 @@
         System.out.println("Found boot loading interfaces: " + list);
         int track = list.size();
         while (!list.isEmpty()) {
-            System.out.println("ITERATING LIST IS " + list);
-            for (BootupInterface iface : new ArrayList<>(list)) {
+            for (BootableBeanInterface iface : new ArrayList<>(list)) {
                 try {
-                    iface.load();
+                    iface.load(BeansFactory.getKustvaktContext());
                 }catch (KustvaktException e) {
                     // don't do anything!
                     System.out.println(
@@ -124,8 +120,7 @@
             runPreStart();
 
         if (kargs.port == -1)
-            kargs.setPort(
-                    BeanConfiguration.getBeans().getConfiguration().getPort());
+            kargs.setPort(BeansFactory.getKustvaktContext().getConfiguration().getPort());
 
         System.out.println(
                 "Starting Kustvakt Service on port '" + kargs.port + "'");
@@ -175,9 +170,6 @@
         private boolean debug;
         @Getter
         private String config;
-        @Getter
-        @Deprecated
-        private String properties;
         private int port;
         private SslContextFactory sslContext;
         private String[] rootPackages;
@@ -188,7 +180,6 @@
             this.sslContext = null;
             this.debug = false;
             this.config = null;
-            this.properties = null;
             this.init = false;
         }
 
diff --git a/src/main/java/de/ids_mannheim/korap/web/SearchKrill.java b/src/main/java/de/ids_mannheim/korap/web/SearchKrill.java
index 69a843e..18440a2 100644
--- a/src/main/java/de/ids_mannheim/korap/web/SearchKrill.java
+++ b/src/main/java/de/ids_mannheim/korap/web/SearchKrill.java
@@ -45,7 +45,7 @@
                 if (!f.exists()) {
                     KustvaktLogger.ERROR_LOGGER.error("Index not found!");
                     System.exit(-1);
-                };
+                }
                 this.index = new KrillIndex(new MMapDirectory(Paths.get(path)));
             };
         } catch (IOException e) {
diff --git a/src/main/java/de/ids_mannheim/korap/web/filter/AuthFilter.java b/src/main/java/de/ids_mannheim/korap/web/filter/AuthFilter.java
index cb419fd..cc4e68c 100644
--- a/src/main/java/de/ids_mannheim/korap/web/filter/AuthFilter.java
+++ b/src/main/java/de/ids_mannheim/korap/web/filter/AuthFilter.java
@@ -4,7 +4,7 @@
 import com.sun.jersey.spi.container.ContainerRequestFilter;
 import com.sun.jersey.spi.container.ContainerResponseFilter;
 import com.sun.jersey.spi.container.ResourceFilter;
-import de.ids_mannheim.korap.config.BeanConfiguration;
+import de.ids_mannheim.korap.config.BeansFactory;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.interfaces.AuthenticationManagerIface;
 import de.ids_mannheim.korap.user.TokenContext;
@@ -23,7 +23,7 @@
     private AuthenticationManagerIface userController;
 
     public AuthFilter() {
-        this.userController = BeanConfiguration.getBeans()
+        this.userController = BeansFactory.getKustvaktContext()
                 .getAuthenticationManager();
     }
 
diff --git a/src/main/java/de/ids_mannheim/korap/web/filter/DefaultFilter.java b/src/main/java/de/ids_mannheim/korap/web/filter/DefaultFilter.java
index 30e8961..2626349 100644
--- a/src/main/java/de/ids_mannheim/korap/web/filter/DefaultFilter.java
+++ b/src/main/java/de/ids_mannheim/korap/web/filter/DefaultFilter.java
@@ -4,7 +4,7 @@
 import com.sun.jersey.spi.container.ContainerRequestFilter;
 import com.sun.jersey.spi.container.ContainerResponseFilter;
 import com.sun.jersey.spi.container.ResourceFilter;
-import de.ids_mannheim.korap.config.BeanConfiguration;
+import de.ids_mannheim.korap.config.BeansFactory;
 import de.ids_mannheim.korap.user.TokenContext;
 import de.ids_mannheim.korap.user.User;
 import de.ids_mannheim.korap.utils.TimeUtils;
@@ -54,7 +54,7 @@
         c.setHostAddress(host);
         c.setUserAgent(agent);
         c.setExpirationTime(TimeUtils.plusSeconds(
-                BeanConfiguration.getBeans().getConfiguration()
+                BeansFactory.getKustvaktContext().getConfiguration()
                         .getShortTokenTTL()).getMillis());
         return c;
     }
diff --git a/src/main/java/de/ids_mannheim/korap/web/filter/PiwikFilter.java b/src/main/java/de/ids_mannheim/korap/web/filter/PiwikFilter.java
index 9c9cd9c..3fdec88 100644
--- a/src/main/java/de/ids_mannheim/korap/web/filter/PiwikFilter.java
+++ b/src/main/java/de/ids_mannheim/korap/web/filter/PiwikFilter.java
@@ -10,7 +10,7 @@
 import com.sun.jersey.spi.container.ContainerRequestFilter;
 import com.sun.jersey.spi.container.ContainerResponseFilter;
 import com.sun.jersey.spi.container.ResourceFilter;
-import de.ids_mannheim.korap.config.BeanConfiguration;
+import de.ids_mannheim.korap.config.BeansFactory;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.interfaces.AuthenticationManagerIface;
 import de.ids_mannheim.korap.user.*;
@@ -40,7 +40,7 @@
     private AuthenticationManagerIface controller;
 
     public PiwikFilter() {
-        controller = BeanConfiguration.getBeans().getAuthenticationManager();
+        controller = BeansFactory.getKustvaktContext().getAuthenticationManager();
         ClientConfig config = new DefaultClientConfig();
         Client client = Client.create(config);
         if (jlog.isDebugEnabled())
diff --git a/src/main/java/de/ids_mannheim/korap/web/service/CollectionLoader.java b/src/main/java/de/ids_mannheim/korap/web/service/CollectionLoader.java
index b676f88..aaf5146 100644
--- a/src/main/java/de/ids_mannheim/korap/web/service/CollectionLoader.java
+++ b/src/main/java/de/ids_mannheim/korap/web/service/CollectionLoader.java
@@ -1,12 +1,14 @@
 package de.ids_mannheim.korap.web.service;
 
-import de.ids_mannheim.korap.config.BeanConfiguration;
+import de.ids_mannheim.korap.config.ContextHolder;
 import de.ids_mannheim.korap.config.KustvaktConfiguration;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.exceptions.StatusCodes;
 import de.ids_mannheim.korap.resources.Permissions;
 import de.ids_mannheim.korap.resources.VirtualCollection;
 import de.ids_mannheim.korap.security.ac.PolicyBuilder;
+import de.ids_mannheim.korap.security.ac.ResourceFinder;
+import de.ids_mannheim.korap.security.ac.SecurityManager;
 import de.ids_mannheim.korap.user.Attributes;
 import de.ids_mannheim.korap.user.User;
 import de.ids_mannheim.korap.utils.CollectionQueryBuilder3;
@@ -16,54 +18,54 @@
  * @author hanl
  * @date 12/01/2016
  */
-public class CollectionLoader implements BootupInterface {
+public class CollectionLoader implements BootableBeanInterface {
 
     @Override
-    public void load() throws KustvaktException {
-        if (BeanConfiguration.hasContext()) {
-            User user = User.UserFactory
-                    .toUser(KustvaktConfiguration.KUSTVAKT_USER);
+    public void load(ContextHolder beans) throws KustvaktException {
+        SecurityManager.overrideProviders(beans);
+        ResourceFinder.overrideProviders(beans);
 
-            //todo: load default collections!
-            CollectionQueryBuilder3 bui = new CollectionQueryBuilder3();
-            bui.addQuery("creationDate since 1775");
+        User user = User.UserFactory
+                .toUser(KustvaktConfiguration.KUSTVAKT_USER);
 
-            VirtualCollection c1 = new VirtualCollection();
-            c1.setName("Weimarer Werke");
-            c1.addField(Attributes.QUERY, bui.toJSON());
+        CollectionQueryBuilder3 bui = new CollectionQueryBuilder3();
+        bui.addQuery("creationDate since 1775");
 
-            c1.setDescription("Goethe-Werke in Weimar (seit 1775)");
+        VirtualCollection c1 = new VirtualCollection();
+        c1.setName("Weimarer Werke");
+        c1.addField(Attributes.QUERY, bui.toJSON());
 
-            bui = new CollectionQueryBuilder3();
-            bui.addQuery("textType = Aphorismus");
+        c1.setDescription("Goethe-Werke in Weimar (seit 1775)");
 
-            VirtualCollection c2 = new VirtualCollection();
-            c2.setName("Aphorismen");
-            c2.addField(Attributes.QUERY, bui.toJSON());
-            c2.setDescription("Aphorismentexte Goethes");
+        bui = new CollectionQueryBuilder3();
+        bui.addQuery("textType = Aphorismus");
 
-            bui = new CollectionQueryBuilder3();
-            bui.addQuery("title ~ \"Werther\"");
+        VirtualCollection c2 = new VirtualCollection();
+        c2.setName("Aphorismen");
+        c2.addField(Attributes.QUERY, bui.toJSON());
+        c2.setDescription("Aphorismentexte Goethes");
 
-            VirtualCollection c3 = new VirtualCollection();
-            c3.setName("Werther");
-            c3.addField(Attributes.QUERY, bui.toJSON());
-            c3.setDescription("Goethe - Die Leiden des jungen Werther");
+        bui = new CollectionQueryBuilder3();
+        bui.addQuery("title ~ \"Werther\"");
 
-            PolicyBuilder b = new PolicyBuilder(user);
-            b.setPermissions(Permissions.Permission.READ);
-            b.setResources(c1, c2, c3);
-            b.setConditions("public");
-            String result = b.create();
+        VirtualCollection c3 = new VirtualCollection();
+        c3.setName("Werther");
+        c3.addField(Attributes.QUERY, bui.toJSON());
+        c3.setDescription("Goethe - Die Leiden des jungen Werther");
 
-            if (JsonUtils.readTree(result).size() > 0)
-                throw new KustvaktException(StatusCodes.REQUEST_INVALID,
-                        "creating collections caused errors", result);
-        }
+        PolicyBuilder b = new PolicyBuilder(user);
+        b.setPermissions(Permissions.Permission.READ);
+        b.setResources(c1, c2, c3);
+        b.setConditions("public");
+        String result = b.create();
+
+        if (JsonUtils.readTree(result).size() > 0)
+            throw new KustvaktException(StatusCodes.REQUEST_INVALID,
+                    "creating collections caused errors", result);
     }
 
     @Override
-    public Class<? extends BootupInterface>[] getDependencies() {
+    public Class<? extends BootableBeanInterface>[] getDependencies() {
         return new Class[] { UserLoader.class };
     }
 }
diff --git a/src/main/java/de/ids_mannheim/korap/web/service/PolicyLoader.java b/src/main/java/de/ids_mannheim/korap/web/service/PolicyLoader.java
index af6df90..f568c88 100644
--- a/src/main/java/de/ids_mannheim/korap/web/service/PolicyLoader.java
+++ b/src/main/java/de/ids_mannheim/korap/web/service/PolicyLoader.java
@@ -1,34 +1,54 @@
 package de.ids_mannheim.korap.web.service;
 
-import de.ids_mannheim.korap.config.BeanConfiguration;
+import de.ids_mannheim.korap.config.ContextHolder;
 import de.ids_mannheim.korap.config.KustvaktConfiguration;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.resources.Corpus;
+import de.ids_mannheim.korap.resources.Foundry;
+import de.ids_mannheim.korap.resources.KustvaktResource;
 import de.ids_mannheim.korap.resources.Permissions;
 import de.ids_mannheim.korap.security.ac.PolicyBuilder;
+import de.ids_mannheim.korap.security.ac.ResourceFinder;
+import de.ids_mannheim.korap.security.ac.SecurityManager;
 import de.ids_mannheim.korap.user.User;
 
 /**
  * @author hanl
  * @date 15/01/2016
  */
-public class PolicyLoader implements BootupInterface {
+public class PolicyLoader implements BootableBeanInterface {
 
     @Override
-    public void load() throws KustvaktException {
-        if (BeanConfiguration.hasContext()) {
-            User user = User.UserFactory
-                    .toUser(KustvaktConfiguration.KUSTVAKT_USER);
-            PolicyBuilder builder = new PolicyBuilder(user);
-            builder.addCondition("public");
-            builder.setResources(new Corpus("GOE"));
-            builder.setPermissions(Permissions.Permission.READ);
-            builder.create();
-        }
+    public void load(ContextHolder beans) throws KustvaktException {
+        SecurityManager.overrideProviders(beans);
+        ResourceFinder.overrideProviders(beans);
+
+        User user = User.UserFactory
+                .toUser(KustvaktConfiguration.KUSTVAKT_USER);
+        PolicyBuilder builder = new PolicyBuilder(user);
+        builder.addCondition("public");
+        builder.setResources(new Corpus("GOE"));
+        builder.setPermissions(Permissions.Permission.READ);
+        builder.create();
+
+        builder = new PolicyBuilder(user);
+        builder.addCondition("public");
+        builder.setResources(new Corpus("WPD"));
+        builder.setPermissions(Permissions.Permission.READ);
+        builder.create();
+
+        KustvaktResource tt = new Foundry("tt");
+        tt.setName("TreeTagger");
+        tt.setDescription("todo ...");
+        builder = new PolicyBuilder(user);
+        builder.addCondition("public");
+        builder.setResources(tt);
+        builder.setPermissions(Permissions.Permission.READ);
+        builder.create();
     }
 
     @Override
-    public Class<? extends BootupInterface>[] getDependencies() {
+    public Class<? extends BootableBeanInterface>[] getDependencies() {
         return new Class[] { UserLoader.class };
     }
 }
diff --git a/src/main/java/de/ids_mannheim/korap/web/service/UserLoader.java b/src/main/java/de/ids_mannheim/korap/web/service/UserLoader.java
index ed233a1..4ea11db 100644
--- a/src/main/java/de/ids_mannheim/korap/web/service/UserLoader.java
+++ b/src/main/java/de/ids_mannheim/korap/web/service/UserLoader.java
@@ -1,6 +1,6 @@
 package de.ids_mannheim.korap.web.service;
 
-import de.ids_mannheim.korap.config.BeanConfiguration;
+import de.ids_mannheim.korap.config.ContextHolder;
 import de.ids_mannheim.korap.config.KustvaktConfiguration;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.interfaces.AuthenticationManagerIface;
@@ -9,19 +9,18 @@
  * @author hanl
  * @date 12/01/2016
  */
-public class UserLoader implements BootupInterface {
+public class UserLoader implements BootableBeanInterface {
+
     @Override
-    public void load() throws KustvaktException {
-        if (BeanConfiguration.hasContext()) {
-            AuthenticationManagerIface manager = BeanConfiguration.getBeans()
-                    .getAuthenticationManager();
-            manager.createUserAccount(KustvaktConfiguration.KUSTVAKT_USER,
-                    false);
-        }
+    public void load(ContextHolder beans) throws KustvaktException {
+        AuthenticationManagerIface manager = beans
+                .getAuthenticationManager();
+        manager.createUserAccount(KustvaktConfiguration.KUSTVAKT_USER,
+                false);
     }
 
     @Override
-    public Class<? extends BootupInterface>[] getDependencies() {
+    public Class<? extends BootableBeanInterface>[] getDependencies() {
         return new Class[0];
     }
 }
diff --git a/src/main/java/de/ids_mannheim/korap/web/service/full/AuthService.java b/src/main/java/de/ids_mannheim/korap/web/service/full/AuthService.java
index 490479d..27de612 100644
--- a/src/main/java/de/ids_mannheim/korap/web/service/full/AuthService.java
+++ b/src/main/java/de/ids_mannheim/korap/web/service/full/AuthService.java
@@ -2,7 +2,7 @@
 
 import com.sun.jersey.spi.container.ContainerRequest;
 import com.sun.jersey.spi.container.ResourceFilters;
-import de.ids_mannheim.korap.config.BeanConfiguration;
+import de.ids_mannheim.korap.config.BeansFactory;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.exceptions.StatusCodes;
 import de.ids_mannheim.korap.interfaces.AuthenticationManagerIface;
@@ -10,7 +10,7 @@
 import de.ids_mannheim.korap.user.*;
 import de.ids_mannheim.korap.utils.JsonUtils;
 import de.ids_mannheim.korap.utils.KustvaktLogger;
-import de.ids_mannheim.korap.utils.ServiceVersion;
+import de.ids_mannheim.korap.utils.ServiceInfo;
 import de.ids_mannheim.korap.web.KustvaktServer;
 import de.ids_mannheim.korap.web.filter.AuthFilter;
 import de.ids_mannheim.korap.web.filter.DefaultFilter;
@@ -44,7 +44,7 @@
     //    private SendMail mail;
 
     public AuthService() {
-        this.controller = BeanConfiguration.getBeans()
+        this.controller = BeansFactory.getKustvaktContext()
                 .getAuthenticationManager();
         //todo: replace with real property values
         //        this.mail = new SendMail(ExtConfiguration.getMailProperties());
@@ -63,10 +63,10 @@
     public Response bootstrap() {
         Map m = new HashMap();
 //        m.put("settings", new UserSettings().toObjectMap());
-        m.put("ql", BeanConfiguration.getBeans().getConfiguration()
+        m.put("ql", BeansFactory.getKustvaktContext().getConfiguration()
                 .getQueryLanguages());
         m.put("SortTypes", null); // types of sorting that are supported!
-        m.put("version", ServiceVersion.getAPIVersion());
+        m.put("version", ServiceInfo.getInfo().getVersion());
         return Response.ok(JsonUtils.toJSON(m)).build();
     }
 
diff --git a/src/main/java/de/ids_mannheim/korap/web/service/full/OAuthService.java b/src/main/java/de/ids_mannheim/korap/web/service/full/OAuthService.java
index 5e5e2cf..463e068 100644
--- a/src/main/java/de/ids_mannheim/korap/web/service/full/OAuthService.java
+++ b/src/main/java/de/ids_mannheim/korap/web/service/full/OAuthService.java
@@ -65,11 +65,11 @@
 
     public OAuthService() {
         this.handler = new OAuth2Handler(
-                BeanConfiguration.getBeans().getPersistenceClient());
-        this.controller = BeanConfiguration.getBeans()
+                BeansFactory.getKustvaktContext().getPersistenceClient());
+        this.controller = BeansFactory.getKustvaktContext()
                 .getAuthenticationManager();
-        this.crypto = BeanConfiguration.getBeans().getEncryption();
-        this.config = BeanConfiguration.getBeans().getConfiguration();
+        this.crypto = BeansFactory.getKustvaktContext().getEncryption();
+        this.config = BeansFactory.getKustvaktContext().getConfiguration();
     }
 
     @POST
diff --git a/src/main/java/de/ids_mannheim/korap/web/service/full/ResourceService.java b/src/main/java/de/ids_mannheim/korap/web/service/full/ResourceService.java
index 3b0691e..cd10d64 100644
--- a/src/main/java/de/ids_mannheim/korap/web/service/full/ResourceService.java
+++ b/src/main/java/de/ids_mannheim/korap/web/service/full/ResourceService.java
@@ -3,7 +3,7 @@
 import com.fasterxml.jackson.databind.JsonNode;
 import com.sun.jersey.core.util.MultivaluedMapImpl;
 import com.sun.jersey.spi.container.ResourceFilters;
-import de.ids_mannheim.korap.config.BeanConfiguration;
+import de.ids_mannheim.korap.config.BeansFactory;
 import de.ids_mannheim.korap.config.KustvaktConfiguration;
 import de.ids_mannheim.korap.exceptions.EmptyResultException;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
@@ -12,8 +12,7 @@
 import de.ids_mannheim.korap.interfaces.AuthenticationManagerIface;
 import de.ids_mannheim.korap.query.serialize.MetaQueryBuilder;
 import de.ids_mannheim.korap.query.serialize.QuerySerializer;
-import de.ids_mannheim.korap.resource.rewrite.FoundryInject;
-import de.ids_mannheim.korap.resource.rewrite.RewriteHandler;
+import de.ids_mannheim.korap.resource.rewrite.*;
 import de.ids_mannheim.korap.resources.*;
 import de.ids_mannheim.korap.security.ac.ResourceFinder;
 import de.ids_mannheim.korap.security.ac.ResourceHandler;
@@ -60,17 +59,18 @@
     private RewriteHandler processor;
 
     public ResourceService() {
-        this.controller = BeanConfiguration.getBeans()
+        this.controller = BeansFactory.getKustvaktContext()
                 .getAuthenticationManager();
-        this.config = BeanConfiguration.getBeans().getConfiguration();
+        this.config = BeansFactory.getKustvaktContext().getConfiguration();
         this.resourceHandler = new ResourceHandler();
         this.searchKrill = new SearchKrill(config.getIndexDir());
 
         UriBuilder builder = UriBuilder.fromUri("http://10.0.10.13").port(9997);
         this.graphDBhandler = new ClientsHandler(builder.build());
 
-        this.processor = new RewriteHandler(config);
-        this.processor.add(FoundryInject.class);
+        this.processor = new RewriteHandler();
+        this.processor.defaultRewriteConstraints();
+        this.processor.insertBeans(BeansFactory.getKustvaktContext());
     }
 
     /**
@@ -304,10 +304,20 @@
         TokenContext ctx = (TokenContext) securityContext.getUserPrincipal();
         QuerySerializer ss;
         CollectionQueryBuilder3 cquery = new CollectionQueryBuilder3();
+        if (cq != null)
+            cquery.setBaseQuery(cq);
+
         User user;
         try {
             user = controller.getUser(ctx.getUsername());
-            Set<Corpus> resources = ResourceFinder.search(user, Corpus.class);
+            Set<Corpus> resources = new HashSet<>();
+
+            if (User.UserFactory.isDemo(ctx.getUsername()))
+                resources = ResourceFinder.searchPublic(Corpus.class);
+            else
+                resources = ResourceFinder.search(user, Corpus.class);
+            System.out.println("RESOURCES FOUND "+ resources);
+
             for (KustvaktResource corpus : resources)
                 cquery.addQuery("corpusID=" + corpus.getPersistentID());
         }catch (KustvaktException e) {
@@ -315,8 +325,7 @@
         }
 
         ss = new QuerySerializer().setQuery(q, ql, v);
-        if (cq != null)
-            ss.setCollection(cq);
+        ss.setCollection(cquery.toJSON());
 
         MetaQueryBuilder meta = new MetaQueryBuilder();
         if (pageIndex != null)
@@ -347,7 +356,8 @@
      * @param pageIndex
      * @return
      */
-    // todo: test
+
+    //todo: does cq have any sensable worth here?
     @TRACE
     @Path("{type}/{id}/search")
     public Response buildQuery(@Context Locale locale,
@@ -372,6 +382,7 @@
         try {
             User user = controller.getUser(ctx.getUsername());
 
+            //todo: instead of throwing exception, build notification and rewrites into result query
             KustvaktResource resource;
             if (StringUtils.isInteger(id))
                 resource = this.resourceHandler
@@ -387,15 +398,11 @@
 
         }catch (KustvaktException e) {
             KustvaktLogger.ERROR_LOGGER.error("Exception encountered!", e);
-            throw KustvaktResponseHandler.throwit(e);
+            //throw KustvaktResponseHandler.throwit(e);
         }
 
         ss = new QuerySerializer().setQuery(q, ql, v);
 
-        // todo: parse resources
-        if (cq != null)
-            ss.setCollection(cq);
-
         MetaQueryBuilder meta = new MetaQueryBuilder();
         if (pageIndex != null)
             meta.addEntry("startIndex", pageIndex);
@@ -483,7 +490,7 @@
         //        meta.addEntry("itemsPerResource", 1);
         serializer.setMeta(meta.raw());
 
-        // policy rewrite!
+        //fixme: policy rewrite!
         String query = this.processor.preProcess(serializer.toJSON(), user);
 
         jlog.info("the serialized query {}", query);
@@ -567,8 +574,6 @@
                             .throwit(StatusCodes.ILLEGAL_ARGUMENT,
                                     "Type parameter not supported", type);
 
-                //                functions.createQuery(id, type, user, query, ql, v);
-
                 meta.addEntry("startIndex", pageIndex);
                 meta.addEntry("startPage", pageInteger);
                 meta.setSpanContext(ctx);
@@ -582,6 +587,8 @@
                 query = s.toJSON();
                 //                PolicyParser parser = new PolicyParser(user);
                 //                query = parser.parse(s.toJSON());
+                //todo: 1
+
             }
             String result;
             try {
@@ -899,7 +906,7 @@
                 cachetmp.setStats(JsonUtils.readSimple(stats, Map.class));
             }
 
-            if (!cache && !user.isDemo()) {
+            if (!cache && !User.UserFactory.isDemo(ctx.getUsername())) {
                 collection = ResourceFactory
                         .getPermanentCollection(cachetmp, name, description);
                 vals = collection.toMap();
diff --git a/src/main/java/de/ids_mannheim/korap/web/service/full/UserService.java b/src/main/java/de/ids_mannheim/korap/web/service/full/UserService.java
index 973544f..45999fc 100644
--- a/src/main/java/de/ids_mannheim/korap/web/service/full/UserService.java
+++ b/src/main/java/de/ids_mannheim/korap/web/service/full/UserService.java
@@ -4,7 +4,7 @@
 import com.fasterxml.jackson.databind.node.ObjectNode;
 import com.sun.jersey.spi.container.ContainerRequest;
 import com.sun.jersey.spi.container.ResourceFilters;
-import de.ids_mannheim.korap.config.BeanConfiguration;
+import de.ids_mannheim.korap.config.BeansFactory;
 import de.ids_mannheim.korap.config.Scopes;
 import de.ids_mannheim.korap.config.URIParam;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
@@ -38,8 +38,6 @@
 public class UserService {
 
     private static Logger jlog = LoggerFactory.getLogger(UserService.class);
-    //    private static Logger jlog = KustvaktLogger
-    //            .getLogger(KustvaktLogger.SECURITY_LOG);
     private AuthenticationManagerIface controller;
 
     private
@@ -47,7 +45,7 @@
     UriInfo info;
 
     public UserService() {
-        this.controller = BeanConfiguration.getBeans()
+        this.controller = BeansFactory.getKustvaktContext()
                 .getAuthenticationManager();
     }
 
@@ -237,7 +235,7 @@
         try {
             User user = controller.getUser(ctx.getUsername());
             Userdata data = controller.getUserData(user, UserSettings.class);
-            data.addField(Attributes.USERNAME, ctx.getUsername());
+            data.setField(Attributes.USERNAME, ctx.getUsername());
             result = data.data();
         }catch (KustvaktException e) {
             jlog.error("Exception encountered!", e);
@@ -259,7 +257,7 @@
 
         try {
             User user = controller.getUser(ctx.getUsername());
-            if (user.isDemo())
+            if (User.UserFactory.isDemo(ctx.getUsername()))
                 return Response.notModified().build();
 
             Userdata data = controller.getUserData(user, UserSettings.class);
@@ -293,7 +291,7 @@
         try {
             User user = controller.getUser(ctx.getUsername());
             Userdata data = controller.getUserData(user, UserDetails.class);
-            data.addField(Attributes.USERNAME, ctx.getUsername());
+            data.setField(Attributes.USERNAME, ctx.getUsername());
             result = data.data();
         }catch (KustvaktException e) {
             jlog.error("Exception encountered!", e);
@@ -315,7 +313,7 @@
 
         try {
             User user = controller.getUser(ctx.getUsername());
-            if (user.isDemo())
+            if (User.UserFactory.isDemo(ctx.getUsername()))
                 return Response.notModified().build();
 
             UserDetails new_data = new UserDetails(user.getId());
@@ -393,7 +391,7 @@
         TokenContext ctx = (TokenContext) context.getUserPrincipal();
         try {
             User user = controller.getUser(ctx.getUsername());
-            if (user.isDemo())
+            if (User.UserFactory.isDemo(ctx.getUsername()))
                 return Response.notModified().build();
             controller.deleteAccount(user);
         }catch (KustvaktException e) {
diff --git a/src/main/java/de/ids_mannheim/korap/web/service/light/LightService.java b/src/main/java/de/ids_mannheim/korap/web/service/light/LightService.java
index fde88cd..783e7e2 100644
--- a/src/main/java/de/ids_mannheim/korap/web/service/light/LightService.java
+++ b/src/main/java/de/ids_mannheim/korap/web/service/light/LightService.java
@@ -1,7 +1,7 @@
 package de.ids_mannheim.korap.web.service.light;
 
 import com.sun.jersey.core.util.MultivaluedMapImpl;
-import de.ids_mannheim.korap.config.BeanConfiguration;
+import de.ids_mannheim.korap.config.BeansFactory;
 import de.ids_mannheim.korap.config.KustvaktConfiguration;
 import de.ids_mannheim.korap.config.QueryBuilderUtil;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
@@ -44,12 +44,13 @@
     private KustvaktConfiguration config;
 
     public LightService() {
-        this.config = BeanConfiguration.getBeans().getConfiguration();
+        this.config = BeansFactory.getKustvaktContext().getConfiguration();
         this.searchKrill = new SearchKrill(config.getIndexDir());
         UriBuilder builder = UriBuilder.fromUri("http://10.0.10.13").port(9997);
         this.graphDBhandler = new ClientsHandler(builder.build());
-        this.processor = new RewriteHandler(config);
+        this.processor = new RewriteHandler();
         this.processor.add(FoundryInject.class);
+        this.processor.insertBeans(BeansFactory.getKustvaktContext());
     }
 
     /**
@@ -83,7 +84,8 @@
             @QueryParam("count") Integer pageLength,
             @QueryParam("offset") Integer pageIndex,
             @QueryParam("page") Integer startPage,
-            @QueryParam("ref") String reference, @QueryParam("cq") String cq) {
+                               // fixme: remove cq from light service
+            @QueryParam("cq") String cq) {
         QuerySerializer ss = new QuerySerializer().setQuery(q, ql, v);
 
         MetaQueryBuilder meta = new MetaQueryBuilder();
@@ -122,6 +124,7 @@
             @QueryParam("offset") Integer pageIndex,
             @QueryParam("page") Integer pageInteger,
             @QueryParam("fields") Set<String> fields,
+                                    // fixme: remove cq value from lightservice
             @QueryParam("cq") String cq, @QueryParam("engine") String engine) {
         KustvaktConfiguration.BACKENDS eng = this.config.chooseBackend(engine);
 
@@ -148,6 +151,7 @@
                     String.valueOf(meta.getSpanContext().getLeft_size()));
             map.add("rctxs",
                     String.valueOf(meta.getSpanContext().getRight_size()));
+
             try {
                 result = this.graphDBhandler.getResponse(map, "distKwic");
             }catch (KustvaktException e) {
diff --git a/src/main/resources/db/mysql/V0.1__userdatabase.sql b/src/main/resources/db/mysql/V0.1__userdatabase.sql
index cfe31a1..09b1591 100644
--- a/src/main/resources/db/mysql/V0.1__userdatabase.sql
+++ b/src/main/resources/db/mysql/V0.1__userdatabase.sql
@@ -1,3 +1,4 @@
+
 -- rename all columns in new way!
 CREATE TABLE IF NOT EXISTS korap_users (
     id INTEGER PRIMARY KEY AUTO_INCREMENT,
diff --git a/src/main/resources/db/mysql/V0.3__securitydatabase.sql b/src/main/resources/db/mysql/V0.3__securitydatabase.sql
index c8f6816..5406156 100644
--- a/src/main/resources/db/mysql/V0.3__securitydatabase.sql
+++ b/src/main/resources/db/mysql/V0.3__securitydatabase.sql
@@ -111,25 +111,4 @@
 aud_failure VARCHAR(100)
 );
 
-
--- indices
-create trigger delete_policy after delete on resource_store
-for each row delete from policy_store where target_id=OLD.id;
-
-DELIMITER //
-CREATE TRIGGER tree_entry_insert AFTER INSERT ON resource_store FOR EACH ROW BEGIN
-	INSERT INTO resource_tree (parent_id, child_id, depth, name_path)
-	VALUES (NEW.id, NEW.id, 0, NEW.name);
-	INSERT INTO resource_tree (parent_id, child_id, depth, name_path)
-	SELECT parent_id, NEW.id, depth + 1, concat(name_path,"/",NEW.name) FROM resource_tree WHERE child_id = NEW.parent_id;
-END; //
-
-DELIMITER ;
-
--- todo: are this automatically adapted when refactoring?
-CREATE INDEX group_index ON group_users(user_id, group_id);
-CREATE INDEX policy_index ON group_ref(policy_id);
-CREATE UNIQUE INDEX resource_tree_index ON resource_tree (parent_id, depth, child_id);
-CREATE UNIQUE INDEX param_unique ON param_store (p_key, p_value);
-
 -- foreign key constraints
diff --git a/src/main/resources/db/sqlite/V1__Initial_version.sql b/src/main/resources/db/sqlite/V1__Initial_version.sql
index 06663e7..d109779 100644
--- a/src/main/resources/db/sqlite/V1__Initial_version.sql
+++ b/src/main/resources/db/sqlite/V1__Initial_version.sql
@@ -24,13 +24,19 @@
 CREATE TABLE IF NOT EXISTS user_details (
 id INTEGER PRIMARY KEY AUTOINCREMENT,
 user_id INTEGER UNIQUE NOT NULL,
-data BLOB NOT NULL
+data BLOB NOT NULL,
+foreign key (user_id)
+references korap_users (id)
+on delete cascade
 );
 
 CREATE TABLE IF NOT EXISTS user_settings (
 id INTEGER PRIMARY KEY AUTOINCREMENT,
 user_id INTEGER UNIQUE NOT NULL,
-data BLOB NOT NULL
+data BLOB NOT NULL,
+foreign key (user_id)
+references korap_users (id)
+on delete cascade
 );
 
 
@@ -262,8 +268,8 @@
 
 -- deletes a group if the group has no longer members!
 create trigger if not exists group_ref_del after delete on group_ref
-when (select count(*) from group_ref where groupId=OLD.group_id) = 0
-begin delete from groupolicy_store where name=OLD.group_id; end;
+when (select count(*) from group_ref where group_id=OLD.group_id) = 0
+begin delete from group_store where name=OLD.group_id; end;
 
     -- create trigger relCr after insert on resource_store
     -- when (select count(*) from r_tree where parent_id==NEW.id and
diff --git a/src/main/resources/default-config.xml b/src/main/resources/default-config.xml
index 86a5cba..1b0c72c 100644
--- a/src/main/resources/default-config.xml
+++ b/src/main/resources/default-config.xml
@@ -76,7 +76,7 @@
     <bean id="flyway" class="org.flywaydb.core.Flyway" init-method="migrate">
         <property name="baselineOnMigrate" value="false"/>
         <property name="locations"
-                  value="classpath:${jdbc.schemaPath}"/>
+                  value="${jdbc.schemaPath}"/>
         <property name="dataSource" ref="dataSource"/>
     </bean>
 
@@ -161,7 +161,7 @@
                 ref="kustvakt_encryption"/>
     </bean>
 
-    <util:list id="auth_providers"
+    <util:list id="kustvakt_authproviders"
                value-type="de.ids_mannheim.korap.interfaces.AuthenticationIface">
         <ref bean="basic_auth"/>
         <ref bean="session_auth"/>
@@ -169,6 +169,26 @@
         <ref bean="openid_auth"/>
     </util:list>
 
+
+    <bean id="userdata_details"
+          class="de.ids_mannheim.korap.handlers.UserDetailsDao">
+        <constructor-arg
+                type="de.ids_mannheim.korap.interfaces.db.PersistenceClient"
+                ref="kustvakt_db"/>
+    </bean>
+    <bean id="userdata_settings"
+          class="de.ids_mannheim.korap.handlers.UserDetailsDao">
+        <constructor-arg
+                type="de.ids_mannheim.korap.interfaces.db.PersistenceClient"
+                ref="kustvakt_db"/>
+    </bean>
+
+    <util:list id="kustvakt_userdata"
+               value-type="de.ids_mannheim.korap.interfaces.db.UserdataDbIface">
+        <ref bean="userdata_details"/>
+        <ref bean="userdata_settings"/>
+    </util:list>
+
     <!-- specify type for constructor argument -->
     <bean id="kustvakt_authenticationmanager"
           class="de.ids_mannheim.korap.security.auth.KustvaktAuthenticationManager">
@@ -181,8 +201,9 @@
         <constructor-arg
                 type="de.ids_mannheim.korap.interfaces.db.AuditingIface"
                 ref="kustvakt_auditing"/>
+        <constructor-arg ref="kustvakt_userdata"/>
         <!-- inject authentication providers to use -->
-        <property name="providers" ref="auth_providers"/>
+        <property name="providers" ref="kustvakt_authproviders"/>
     </bean>
 
     <!-- todo: if db interfaces not loaded via spring, does transaction even work then? -->
diff --git a/src/main/resources/log4j.properties b/src/main/resources/log4j.properties
index c9186f6..39e040a 100644
--- a/src/main/resources/log4j.properties
+++ b/src/main/resources/log4j.properties
@@ -1,7 +1,7 @@
 
 # Root logger option
 #log4j.threshold=ALL
-log4j.rootLogger=DEBUG, stdout, debugLog
+log4j.rootLogger=WARN, stdout, debugLog
 log4j.logger.log=ERROR, errorLog
 
 # Direct log messages to stdout
diff --git a/src/main/resources/validation.properties b/src/main/resources/validation.properties
old mode 100755
new mode 100644
diff --git a/src/main/resources/version.prop b/src/main/resources/version.prop
deleted file mode 100644
index e5683df..0000000
--- a/src/main/resources/version.prop
+++ /dev/null
@@ -1 +0,0 @@
-version=${project.version}
\ No newline at end of file
diff --git a/src/test/java/CollectionQueryBuilderTest.java b/src/test/java/CollectionQueryBuilderTest.java
index 8acd4fb..ab9706a 100644
--- a/src/test/java/CollectionQueryBuilderTest.java
+++ b/src/test/java/CollectionQueryBuilderTest.java
@@ -2,8 +2,12 @@
 import de.ids_mannheim.korap.query.serialize.QuerySerializer;
 import de.ids_mannheim.korap.utils.CollectionQueryBuilder3;
 import de.ids_mannheim.korap.utils.JsonUtils;
+import org.junit.Assert;
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
 /**
  * @author hanl
  * @date 12/08/2015
@@ -17,10 +21,9 @@
 
         JsonNode node = JsonUtils.readTree(b.toJSON());
 
-        assert node != null;
-        assert node.at("/collection/@type").asText().equals("koral:doc");
-        assert node.at("/collection/key").asText().equals("corpusID");
-
+        assertNotNull(node);
+        assertEquals("koral:doc",node.at("/collection/@type").asText());
+        assertEquals("corpusID",node.at("/collection/key").asText());
     }
 
     @Test
@@ -29,14 +32,12 @@
         b.addQuery("corpusID=WPD & textClass=freizeit");
         JsonNode node = JsonUtils.readTree(b.toJSON());
 
-        assert node != null;
-        assert node.at("/collection/@type").asText().equals("koral:docGroup");
-        assert node.at("/collection/operation").asText()
-                .equals("operation:and");
-        assert node.at("/collection/operands/0/key").asText()
-                .equals("corpusID");
-        assert node.at("/collection/operands/1/key").asText()
-                .equals("textClass");
+        assertNotNull(node);
+        assertEquals("koral:docGroup",node.at("/collection/@type").asText());
+        assertEquals("operation:and",node.at("/collection/operation").asText());
+
+        assertEquals("corpusID",node.at("/collection/operands/0/key").asText());
+        assertEquals("textClass",node.at("/collection/operands/1/key").asText());
     }
 
     @Test
diff --git a/src/test/java/FileAuditingTest.java b/src/test/java/FileAuditingTest.java
index 0e62e12..fecc338 100644
--- a/src/test/java/FileAuditingTest.java
+++ b/src/test/java/FileAuditingTest.java
@@ -1,9 +1,8 @@
 import de.ids_mannheim.korap.auditing.AuditRecord;
-import de.ids_mannheim.korap.config.BeanConfiguration;
+import de.ids_mannheim.korap.config.BeanConfigTest;
+import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.exceptions.StatusCodes;
 import org.joda.time.LocalDate;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
 import org.junit.Test;
 
 import java.util.Date;
@@ -13,16 +12,11 @@
  * @date 27/07/2015
  */
 //todo: test audit commit in thread and that no concurrency issue arrises
-public class FileAuditingTest {
+public class FileAuditingTest extends BeanConfigTest {
 
-    @BeforeClass
-    public static void init() {
-        BeanConfiguration.loadClasspathContext();
-    }
+    @Override
+    public void initMethod() throws KustvaktException {
 
-    @AfterClass
-    public static void finish() {
-        BeanConfiguration.closeApplication();
     }
 
     @Test
@@ -31,13 +25,13 @@
             AuditRecord record = AuditRecord
                     .serviceRecord("MichaelHanl", StatusCodes.ILLEGAL_ARGUMENT,
                             String.valueOf(i), "string value");
-            BeanConfiguration.getBeans().getAuditingProvider().audit(record);
+            helper().getContext().getAuditingProvider().audit(record);
         }
     }
 
     @Test(expected = UnsupportedOperationException.class)
     public void testRetrieval() {
-        BeanConfiguration.getBeans().getAuditingProvider()
+        helper().getContext().getAuditingProvider()
                 .retrieveRecords(new LocalDate(new Date().getTime()), 10);
     }
 
diff --git a/src/test/java/de/ids_mannheim/korap/config/ClassLoaderTest.java b/src/test/java/de/ids_mannheim/korap/config/ClassLoaderTest.java
index edee50d..b40b8c7 100644
--- a/src/test/java/de/ids_mannheim/korap/config/ClassLoaderTest.java
+++ b/src/test/java/de/ids_mannheim/korap/config/ClassLoaderTest.java
@@ -1,52 +1,45 @@
 package de.ids_mannheim.korap.config;
 
+import de.ids_mannheim.korap.exceptions.KustvaktException;
+import de.ids_mannheim.korap.handlers.JDBCAuditing;
 import de.ids_mannheim.korap.interfaces.AuthenticationManagerIface;
 import de.ids_mannheim.korap.interfaces.db.AuditingIface;
-import de.ids_mannheim.korap.interfaces.defaults.DefaultAuditing;
-import org.junit.After;
-import org.junit.Assert;
+import de.ids_mannheim.korap.security.auth.KustvaktAuthenticationManager;
 import org.junit.Test;
 
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
 /**
  * @author hanl
  * @date 27/07/2015
  */
-public class ClassLoaderTest {
-
-    @After
-    public void close() {
-        BeanConfiguration.closeApplication();
-    }    
-
-    @Test
-    public void testBeanConfigurationLoaderThrowsNoException() {
-        BeanConfiguration.loadClasspathContext("default-config.xml");
-        assert BeanConfiguration.hasContext();
-    }
+public class ClassLoaderTest extends BeanConfigTest {
 
     @Test
     public void testDefaultCreationThrowsNoException() {
         DefaultHandler pl = new DefaultHandler();
-        Object o = pl.getDefault(BeanConfiguration.KUSTVAKT_AUDITING);
-        assert o != null;
-        assert o instanceof AuditingIface;
+        Object o = pl.getDefault(ContextHolder.KUSTVAKT_AUDITING);
+        assertNotNull(o);
+        assertTrue(o instanceof AuditingIface);
     }
 
     @Test
-    public void testDefaultCreationThrowsException() {
-        BeanConfiguration.loadClasspathContext();
-        AuthenticationManagerIface iface = BeanConfiguration.getBeans()
+    public void testDefaultCreation2ThrowsNoException() {
+        AuthenticationManagerIface iface = helper().getContext()
                 .getAuthenticationManager();
-        Assert.assertNull("default should be null", iface);
+        assertNotNull(iface);
+        assertTrue(iface instanceof KustvaktAuthenticationManager);
     }
 
     @Test
     public void testDefaultInterfaceMatchThrowsNoException() {
-        BeanConfiguration.loadClasspathContext();
-        AuditingIface iface = BeanConfiguration.getBeans()
-                .getAuditingProvider();
-        assert iface != null;
-        assert iface instanceof DefaultAuditing;
+        AuditingIface iface = helper().getContext().getAuditingProvider();
+        assertNotNull(iface);
+        assertTrue(iface instanceof JDBCAuditing);
     }
 
+    @Override
+    public void initMethod() throws KustvaktException {
+    }
 }
diff --git a/src/test/java/de/ids_mannheim/korap/config/CollectionLoaderTest.java b/src/test/java/de/ids_mannheim/korap/config/CollectionLoaderTest.java
index 1b3a4ea..d3bffd4 100644
--- a/src/test/java/de/ids_mannheim/korap/config/CollectionLoaderTest.java
+++ b/src/test/java/de/ids_mannheim/korap/config/CollectionLoaderTest.java
@@ -4,43 +4,35 @@
 import de.ids_mannheim.korap.handlers.ResourceDao;
 import de.ids_mannheim.korap.web.service.CollectionLoader;
 import de.ids_mannheim.korap.web.service.UserLoader;
-import org.junit.AfterClass;
 import org.junit.Assert;
-import org.junit.BeforeClass;
 import org.junit.Test;
 
 /**
  * @author hanl
  * @date 11/02/2016
  */
-public class CollectionLoaderTest {
-
-    @AfterClass
-    public static void close() {
-        BeanConfiguration.closeApplication();
-    }
-
-    @BeforeClass
-    public static void create() {
-        BeanConfiguration.loadClasspathContext("default-config.xml");
-    }
+public class CollectionLoaderTest extends BeanConfigTest {
 
     @Test
     public void testCollectionLoader() {
         ResourceDao dao = new ResourceDao(
-                BeanConfiguration.getBeans().getPersistenceClient());
+                helper().getContext().getPersistenceClient());
 
         boolean error = false;
         UserLoader u = new UserLoader();
         CollectionLoader l = new CollectionLoader();
         try {
-            u.load();
-            l.load();
+            u.load(helper().getContext());
+            l.load(helper().getContext());
         }catch (KustvaktException e) {
             error = true;
         }
-        assert !error;
+        Assert.assertFalse(error);
         Assert.assertNotEquals("Is not supposed to be zero", 0, dao.size());
+    }
+
+    @Override
+    public void initMethod() throws KustvaktException {
 
     }
 }
diff --git a/src/test/java/de/ids_mannheim/korap/config/ConfigTest.java b/src/test/java/de/ids_mannheim/korap/config/ConfigTest.java
index fddacb2..d9e28e3 100644
--- a/src/test/java/de/ids_mannheim/korap/config/ConfigTest.java
+++ b/src/test/java/de/ids_mannheim/korap/config/ConfigTest.java
@@ -2,78 +2,98 @@
 
 import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.user.Attributes;
-import de.ids_mannheim.korap.utils.ServiceVersion;
+import de.ids_mannheim.korap.utils.ServiceInfo;
 import de.ids_mannheim.korap.utils.TimeUtils;
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
+import de.ids_mannheim.korap.web.service.BootableBeanInterface;
 import org.junit.Test;
 
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+
+import static org.junit.Assert.*;
+
 /**
  * @author hanl
  * @date 02/09/2015
  */
-public class ConfigTest {
-
-    @After
-    public void close() {
-        BeanConfiguration.closeApplication();
-    }
-
-    @Before
-    public void create() {
-        BeanConfiguration.loadClasspathContext("default-config.xml");
-    }
+public class ConfigTest extends BeanConfigTest {
 
     @Test
-    public void testServiceVersion() {
-        String v = ServiceVersion.getAPIVersion();
-        Assert.assertNotEquals("wrong version", "UNKNOWN", v);
+    public void testServiceInfo() {
+        String version = ServiceInfo.getInfo().getVersion();
+        String name = ServiceInfo.getInfo().getName();
+        assertNotEquals("wrong version", "UNKNOWN", version);
+        assertNotEquals("wrong name", "UNKNOWN", name);
     }
 
     @Test
     public void testProperties() {
-        BeanConfiguration.loadClasspathContext();
-
-        Assert.assertEquals("token layer does not match", "opennlp",
-                BeanConfiguration.getBeans().getConfiguration()
-                        .getDefault_token());
-        Assert.assertEquals("token expiration does not match",
+        assertEquals("token layer does not match", "opennlp",
+                helper().getContext().getConfiguration().getDefault_token());
+        assertEquals("token expiration does not match",
                 TimeUtils.convertTimeToSeconds("1D"),
-                BeanConfiguration.getBeans().getConfiguration()
-                        .getLongTokenTTL());
+                helper().getContext().getConfiguration().getLongTokenTTL());
     }
 
     @Test(expected = KustvaktException.class)
     public void testBeanOverrideInjection() throws KustvaktException {
-        BeanConfiguration.loadClasspathContext("default-config.xml");
-
-        BeanConfiguration.getBeans().getConfiguration().setPropertiesAsStream(
+        helper().getContext().getConfiguration().setPropertiesAsStream(
                 ConfigTest.class.getClassLoader()
                         .getResourceAsStream("kustvakt.conf"));
 
         String v = "testmail_&234@ids-mannheim.de";
-        BeanConfiguration.getBeans().getEncryption()
+        helper().getContext().getEncryption()
                 .validateEntry(v, Attributes.EMAIL);
     }
 
-    //    @Test
-    //    public void testArgLoader() {
-    //        String[] args = new String[] { "--port", "8080", "--config",
-    //                "local.conf", "--init" };
-    //        Set<Arg> s = Arg.loadArgs(args);
-    //        assert s.size() == 3;
-    //
-    //        for (Arg arg : s) {
-    //            if (arg instanceof Arg.PortArg)
-    //                assert ((Arg.PortArg) arg).getValue() == 8080;
-    //            if (arg instanceof Arg.ConfigArg)
-    //                assert ((Arg.ConfigArg) arg).getValue().equals("local.conf");
-    //            if (arg instanceof Arg.InitArg)
-    //                assert ((Arg.InitArg) arg).getValue();
-    //        }
-    //    }
+    @Test
+    public void testBootConfigRun() {
+        helper().runBootInterfaces();
+        helper().setupAccount();
+        assertNotNull(helper().getUser());
 
+        Set<Class<? extends BootableBeanInterface>> set = KustvaktClassLoader
+                .loadSubTypes(BootableBeanInterface.class);
+
+        int check = set.size();
+        List<String> tracker = new ArrayList<>();
+        List<BootableBeanInterface> list = new ArrayList<>(set.size());
+        for (Class cl : set) {
+            BootableBeanInterface iface;
+            try {
+                iface = (BootableBeanInterface) cl.newInstance();
+                list.add(iface);
+            }catch (InstantiationException | IllegalAccessException e) {
+                // do nothing
+            }
+        }
+
+        while (!set.isEmpty()) {
+            out_loop:
+            for (BootableBeanInterface iface : new ArrayList<>(list)) {
+                for (Class cl : iface.getDependencies()) {
+                    if (set.contains(cl))
+                        continue out_loop;
+                }
+                tracker.add(iface.getClass().getSimpleName());
+                set.remove(iface.getClass());
+                list.remove(iface);
+            }
+        }
+        assertEquals(check, tracker.size());
+    }
+
+    @Test
+    public void testBootConfigDependencyOrder() {
+        // todo:
+
+    }
+
+    @Override
+    public void initMethod() throws KustvaktException {
+
+    }
 }
 
 
diff --git a/src/test/java/de/ids_mannheim/korap/config/PolicyLoaderTest.java b/src/test/java/de/ids_mannheim/korap/config/PolicyLoaderTest.java
index b9ea3be..a9270d2 100644
--- a/src/test/java/de/ids_mannheim/korap/config/PolicyLoaderTest.java
+++ b/src/test/java/de/ids_mannheim/korap/config/PolicyLoaderTest.java
@@ -5,26 +5,16 @@
 import de.ids_mannheim.korap.web.service.CollectionLoader;
 import de.ids_mannheim.korap.web.service.PolicyLoader;
 import de.ids_mannheim.korap.web.service.UserLoader;
-import org.junit.AfterClass;
-import org.junit.Assert;
-import org.junit.BeforeClass;
 import org.junit.Test;
 
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotEquals;
+
 /**
  * @author hanl
  * @date 11/02/2016
  */
-public class PolicyLoaderTest {
-
-    @AfterClass
-    public static void close() {
-        BeanConfiguration.closeApplication();
-    }
-
-    @BeforeClass
-    public static void create() {
-        BeanConfiguration.loadClasspathContext("default-config.xml");
-    }
+public class PolicyLoaderTest extends BeanConfigTest {
 
     @Test
     public void testPolicyLoader() {
@@ -33,16 +23,20 @@
         CollectionLoader c = new CollectionLoader();
         PolicyLoader l = new PolicyLoader();
         try {
-            u.load();
-            c.load();
-            l.load();
+            u.load(helper().getContext());
+            c.load(helper().getContext());
+            l.load(helper().getContext());
         }catch (KustvaktException e) {
+            e.printStackTrace();
             error = true;
         }
-        assert !error;
+        assertFalse(error);
+        PolicyDao dao = new PolicyDao(helper().getContext().getPersistenceClient());
+        assertNotEquals("Is not supposed to be zero", 0, dao.size());
+    }
 
-        PolicyDao dao = new PolicyDao(
-                BeanConfiguration.getBeans().getPersistenceClient());
-        Assert.assertNotEquals("Is not supposed to be zero", 0, dao.size());
+    @Override
+    public void initMethod() throws KustvaktException {
+
     }
 }
diff --git a/src/test/java/de/ids_mannheim/korap/config/TestBeans.java b/src/test/java/de/ids_mannheim/korap/config/TestBeans.java
new file mode 100644
index 0000000..6961289
--- /dev/null
+++ b/src/test/java/de/ids_mannheim/korap/config/TestBeans.java
@@ -0,0 +1,38 @@
+package de.ids_mannheim.korap.config;
+
+import de.ids_mannheim.korap.interfaces.AuthenticationManagerIface;
+import de.ids_mannheim.korap.interfaces.EncryptionIface;
+import de.ids_mannheim.korap.interfaces.db.*;
+import org.springframework.context.annotation.Bean;
+
+import java.util.List;
+
+/**
+ * @author hanl
+ * @date 20/02/2016
+ */
+public abstract class TestBeans {
+
+    protected PersistenceClient dataSource;
+
+    public abstract PolicyHandlerIface getPolicyDao();
+
+    public abstract KustvaktConfiguration getConfig();
+
+    public abstract EntityHandlerIface getUserDao();
+
+    public abstract AuditingIface getAuditingDao();
+
+    public abstract List<ResourceOperationIface> getResourceDaos();
+
+    public abstract List<UserDataDbIface> getUserdataDaos();
+
+    public abstract EncryptionIface getCrypto();
+
+    public abstract AuthenticationManagerIface getAuthManager();
+
+    @Bean(name = "kustvakt_db")
+    public PersistenceClient getDataSource() {
+        return this.dataSource;
+    }
+}
diff --git a/src/test/java/de/ids_mannheim/korap/config/TestHelper.java b/src/test/java/de/ids_mannheim/korap/config/TestHelper.java
index ae35e02..607cc71 100644
--- a/src/test/java/de/ids_mannheim/korap/config/TestHelper.java
+++ b/src/test/java/de/ids_mannheim/korap/config/TestHelper.java
@@ -1,23 +1,42 @@
 package de.ids_mannheim.korap.config;
 
 import de.ids_mannheim.korap.exceptions.KustvaktException;
-import de.ids_mannheim.korap.handlers.ResourceDao;
-import de.ids_mannheim.korap.interfaces.db.EntityHandlerIface;
-import de.ids_mannheim.korap.interfaces.db.PersistenceClient;
+import de.ids_mannheim.korap.handlers.*;
+import de.ids_mannheim.korap.interfaces.AuthenticationIface;
+import de.ids_mannheim.korap.interfaces.AuthenticationManagerIface;
+import de.ids_mannheim.korap.interfaces.EncryptionIface;
+import de.ids_mannheim.korap.interfaces.db.*;
+import de.ids_mannheim.korap.interfaces.defaults.KustvaktEncryption;
 import de.ids_mannheim.korap.resources.KustvaktResource;
+import de.ids_mannheim.korap.security.ac.PolicyDao;
+import de.ids_mannheim.korap.security.auth.APIAuthentication;
+import de.ids_mannheim.korap.security.auth.BasicHttpAuth;
+import de.ids_mannheim.korap.security.auth.KustvaktAuthenticationManager;
 import de.ids_mannheim.korap.user.Attributes;
 import de.ids_mannheim.korap.user.User;
-import de.ids_mannheim.korap.web.service.BootupInterface;
+import de.ids_mannheim.korap.web.service.BootableBeanInterface;
+import org.apache.commons.dbcp2.BasicDataSource;
+import org.flywaydb.core.Flyway;
+import org.joda.time.DateTime;
 import org.junit.Assert;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.annotation.Bean;
 import org.springframework.jdbc.core.RowCallbackHandler;
 import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
+import org.springframework.jdbc.datasource.SingleConnectionDataSource;
 
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
 import java.io.UnsupportedEncodingException;
 import java.security.NoSuchAlgorithmException;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.util.*;
 
+import static org.junit.Assert.assertNotEquals;
+import static org.junit.Assert.assertNotNull;
+
 /**
  * creates a test user that can be used to access protected functions
  *
@@ -28,163 +47,173 @@
 
     private static final String[] credentials = new String[] { "test1",
             "testPass2015" };
+    private static Class clazz = null;
 
-    public static boolean setupAccount() {
-        boolean r = BeanConfiguration.hasContext();
-        if (r && ((KustvaktBaseDaoInterface) BeanConfiguration.getBeans()
-                .getUserDBHandler()).size() == 0) {
-            EntityHandlerIface dao = BeanConfiguration.getBeans()
-                    .getUserDBHandler();
-            Map m = new HashMap<>();
-            m.put(Attributes.ID, 2);
-            m.put(Attributes.USERNAME, credentials[0]);
-            m.put(Attributes.PASSWORD, credentials[1]);
-            m.put(Attributes.FIRSTNAME, "test");
-            m.put(Attributes.LASTNAME, "user");
-            m.put(Attributes.EMAIL, "test@ids-mannheim.de");
-            m.put(Attributes.ADDRESS, "Mannheim");
-            m.put(Attributes.DEFAULT_LEMMA_FOUNDRY, "test_l");
-            m.put(Attributes.DEFAULT_POS_FOUNDRY, "test_p");
-            m.put(Attributes.DEFAULT_CONST_FOUNDRY, "test_const");
+    private ContextHolder beansHolder;
 
-            Assert.assertNotNull("userdatabase handler must not be null", dao);
-
-            try {
-                BeanConfiguration.getBeans().getAuthenticationManager()
-                        .createUserAccount(m, false);
-            }catch (KustvaktException e) {
-                // do nothing
-                e.printStackTrace();
-                Assert.assertNull("Test user could not be set up", true);
-                return false;
-            }
-        }
-        return r;
+    public static TestHelper newInstance(ApplicationContext ctx)
+            throws Exception {
+        TestHelper b = new TestHelper();
+        b.beansHolder = new ContextHolder(ctx) {
+        };
+        return b;
     }
 
-    public static boolean setupSimpleAccount(String username, String password) {
-        boolean r = BeanConfiguration.hasContext();
-        if (r && ((KustvaktBaseDaoInterface) BeanConfiguration.getBeans()
-                .getUserDBHandler()).size() == 0) {
-            EntityHandlerIface dao = BeanConfiguration.getBeans()
-                    .getUserDBHandler();
+    public <T> T getBean(Class<T> type) {
+        return this.beansHolder.getBean(type);
+    }
+
+    public ContextHolder getContext() {
+        return this.beansHolder;
+    }
+
+    public <T> T getBean(String name) {
+        return (T) this.beansHolder.getBean(name);
+    }
+
+    public TestHelper setupAccount() {
+        KustvaktBaseDaoInterface dao = getBean(ContextHolder.KUSTVAKT_USERDB);
+
+        KustvaktAuthenticationManager manager = getBean(
+                ContextHolder.KUSTVAKT_AUTHENTICATION_MANAGER);
+
+        try {
+            getUser();
+            System.out.println("found user, skipping setup ...");
+            return this;
+        }catch (RuntimeException e) {
+            // do nothing and continue
+        }
+
+        Map m = new HashMap<>();
+        m.put(Attributes.ID, 2);
+        m.put(Attributes.USERNAME, credentials[0]);
+        m.put(Attributes.PASSWORD, credentials[1]);
+        m.put(Attributes.FIRSTNAME, "test");
+        m.put(Attributes.LASTNAME, "user");
+        m.put(Attributes.EMAIL, "test@ids-mannheim.de");
+        m.put(Attributes.ADDRESS, "Mannheim");
+        m.put(Attributes.DEFAULT_LEMMA_FOUNDRY, "test_l");
+        m.put(Attributes.DEFAULT_POS_FOUNDRY, "test_p");
+        m.put(Attributes.DEFAULT_CONST_FOUNDRY, "test_const");
+
+        assertNotNull("userdatabase handler must not be null", dao);
+
+        try {
+            manager.createUserAccount(m, false);
+        }catch (KustvaktException e) {
+            // do nothing
+            e.printStackTrace();
+            assertNotNull("Test user could not be set up", null);
+        }
+        assertNotEquals(0, dao.size());
+        return this;
+    }
+
+    public TestHelper setupSimpleAccount(String username, String password) {
+        KustvaktBaseDaoInterface dao = getBean(ContextHolder.KUSTVAKT_USERDB);
+
+        if (dao.size() == 0) {
             Map m = new HashMap<>();
             m.put(Attributes.USERNAME, username);
 
             try {
-                String hash = BeanConfiguration.getBeans().getEncryption()
+                String hash = ((EncryptionIface) getBean(
+                        ContextHolder.KUSTVAKT_ENCRYPTION))
                         .produceSecureHash(password);
                 m.put(Attributes.PASSWORD, hash);
             }catch (NoSuchAlgorithmException | UnsupportedEncodingException | KustvaktException e) {
-
+                // do nohting
+                assertNotNull("Exception thrown", null);
             }
-            Assert.assertNotNull("userdatabase handler must not be null", dao);
+            assertNotNull("userdatabase handler must not be null", dao);
 
             try {
-                int i = dao.createAccount(User.UserFactory.toKorAPUser(m));
-                assert BeanConfiguration.getBeans().getUserDBHandler()
+                EntityHandlerIface edao = (EntityHandlerIface) dao;
+                int i = edao.createAccount(User.UserFactory.toKorAPUser(m));
+                assert BeansFactory.getKustvaktContext().getUserDBHandler()
                         .getAccount(credentials[0]) != null;
                 assert i == 1;
             }catch (KustvaktException e) {
                 // do nothing
                 Assert.assertNull("Test user could not be set up", true);
-                return false;
             }
         }
-        return r;
+        return this;
     }
 
-    public static User getUser() {
-        if (BeanConfiguration.hasContext()) {
-            try {
-                return BeanConfiguration.getBeans().getUserDBHandler()
-                        .getAccount(credentials[0]);
-            }catch (KustvaktException e) {
-                e.printStackTrace();
-            }
+    public User getUser() {
+        try {
+            return ((EntityHandlerIface) getBean(ContextHolder.KUSTVAKT_USERDB))
+                    .getAccount(credentials[0]);
+        }catch (KustvaktException e) {
+            // do nothing
         }
         throw new RuntimeException("User could not be retrieved!");
     }
 
-    public static boolean dropUser(String... usernames) {
-        if (usernames == null || usernames.length == 0)
-            usernames = new String[] { credentials[0] };
-        if (BeanConfiguration.hasContext()) {
-            for (String name : usernames)
-                remove(name);
+    public TestHelper dropUser(String... usernames) throws KustvaktException {
+        if (usernames == null || usernames.length == 0) {
+            KustvaktBaseDaoInterface dao = getBean(
+                    ContextHolder.KUSTVAKT_USERDB);
+            dao.truncate();
         }
-        return BeanConfiguration.hasContext();
+        for (String name : Arrays.asList(usernames)) {
+            if (remove(name))
+                break;
+        }
+        return this;
     }
 
-    private static void remove(String username) {
-        EntityHandlerIface dao = BeanConfiguration.getBeans()
-                .getUserDBHandler();
-        try {
-            User us = dao.getAccount(username);
-            dao.deleteAccount(us.getId());
-        }catch (KustvaktException e) {
-            // do nothing
-        }
+    private boolean remove(String username) throws KustvaktException {
+        EntityHandlerIface dao = getBean(ContextHolder.KUSTVAKT_USERDB);
+        User us = dao.getAccount(username);
+        dao.deleteAccount(us.getId());
+        return true;
     }
 
-    public static void drop() {
-        if (BeanConfiguration.hasContext()) {
-            PersistenceClient cl = BeanConfiguration.getBeans()
-                    .getPersistenceClient();
-            String sql = "drop database " + cl.getDatabase() + ";";
-            NamedParameterJdbcTemplate jdbc = (NamedParameterJdbcTemplate) cl
-                    .getSource();
-            jdbc.update(sql, new HashMap<String, Object>());
-        }
-    }
+    public TestHelper truncateAll() {
+        String sql = "SELECT Concat('TRUNCATE TABLE ', TABLE_NAME) FROM INFORMATION_SCHEMA.TABLES";
+        final Set<String> queries = new HashSet<>();
+        PersistenceClient cl = getBean(ContextHolder.KUSTVAKT_POLICIES);
+        NamedParameterJdbcTemplate source = (NamedParameterJdbcTemplate) cl
+                .getSource();
 
-    public static boolean truncateAll() {
-        boolean r = BeanConfiguration.hasContext();
-        if (r) {
-            String sql = "SELECT Concat('TRUNCATE TABLE ', TABLE_NAME) FROM INFORMATION_SCHEMA.TABLES";
-            final Set<String> queries = new HashSet<>();
-            PersistenceClient cl = BeanConfiguration.getBeans()
-                    .getPersistenceClient();
-            NamedParameterJdbcTemplate source = (NamedParameterJdbcTemplate) cl
-                    .getSource();
+        source.query(sql, new RowCallbackHandler() {
+            @Override
+            public void processRow(ResultSet rs) throws SQLException {
+                queries.add(rs.getString(1));
 
-            source.query(sql, new RowCallbackHandler() {
-                @Override
-                public void processRow(ResultSet rs) throws SQLException {
-                    queries.add(rs.getString(1));
-
-                }
-            });
-            System.out.println(queries);
-            for (String query : queries)
-                source.update(query, new HashMap<String, Object>());
-        }
-        return r;
+            }
+        });
+        System.out.println(queries);
+        for (String query : queries)
+            source.update(query, new HashMap<String, Object>());
+        return this;
     }
 
     public static final String[] getUserCredentials() {
         return Arrays.copyOf(credentials, 2);
     }
 
-    public static void runBootInterfaces() {
-        Set<Class<? extends BootupInterface>> set = KustvaktClassLoader
-                .loadSubTypes(BootupInterface.class);
+    public TestHelper runBootInterfaces() {
+        Set<Class<? extends BootableBeanInterface>> set = KustvaktClassLoader
+                .loadSubTypes(BootableBeanInterface.class);
 
-        List<BootupInterface> list = new ArrayList<>(set.size());
+        List<BootableBeanInterface> list = new ArrayList<>(set.size());
         for (Class cl : set) {
-            BootupInterface iface;
+            BootableBeanInterface iface;
             try {
-                iface = (BootupInterface) cl.newInstance();
+                iface = (BootableBeanInterface) cl.newInstance();
                 list.add(iface);
             }catch (InstantiationException | IllegalAccessException e) {
                 // do nothing
             }
         }
         System.out.println("Found boot loading interfaces: " + list);
-        int i = 0;
         while (!set.isEmpty()) {
             out_loop:
-            for (BootupInterface iface : new ArrayList<>(list)) {
+            for (BootableBeanInterface iface : new ArrayList<>(list)) {
                 try {
                     System.out.println(
                             "Running boot instructions from class " + iface
@@ -193,47 +222,224 @@
                         if (set.contains(cl))
                             continue out_loop;
                     }
-                    iface.load();
                     set.remove(iface.getClass());
                     list.remove(iface);
+                    iface.load(beansHolder);
                 }catch (KustvaktException e) {
                     // don't do anything!
                     System.out.println(
                             "An error occurred in class " + iface.getClass()
                                     .getSimpleName() + "!\n" + e);
+                    throw new RuntimeException(
+                            "Boot loading interface failed ...");
                 }
             }
-            i++;
-            if (i == set.size() * 2) {
-                System.out.println(
-                        "Could not run startup scripts. Exiting programme!");
-                System.exit(-1);
-            }
         }
+        return this;
     }
 
-    public static void setupResource(KustvaktResource resource, User user)
+    public int setupResource(KustvaktResource resource)
             throws KustvaktException {
         ResourceDao dao = new ResourceDao(
-                BeanConfiguration.getBeans().getPersistenceClient());
-        dao.storeResource(resource, user);
+                (PersistenceClient) getBean(ContextHolder.KUSTVAKT_DB));
+        return dao.storeResource(resource, getUser());
     }
 
-    public static KustvaktResource getResource(String name)
-            throws KustvaktException {
+    public KustvaktResource getResource(String name) throws KustvaktException {
         ResourceDao dao = new ResourceDao(
-                BeanConfiguration.getBeans().getPersistenceClient());
-        return dao.findbyId(name, getUser());
+                (PersistenceClient) getBean(ContextHolder.KUSTVAKT_DB));
+        KustvaktResource res = dao.findbyId(name, getUser());
+        if (res == null)
+            throw new RuntimeException(
+                    "resource with name " + name + " not found ...");
+        return res;
     }
 
-    public static void dropResource(String name) throws KustvaktException {
+    public TestHelper dropResource(String... names) throws KustvaktException {
         ResourceDao dao = new ResourceDao(
-                BeanConfiguration.getBeans().getPersistenceClient());
-        dao.deleteResource(name, null);
+                (PersistenceClient) getBean(ContextHolder.KUSTVAKT_DB));
+        if (names == null || names.length == 0)
+            dao.truncate();
+        for (String name : names)
+            dao.deleteResource(name, null);
+        return this;
+    }
 
+    public void close() {
+        BeansFactory.closeApplication();
     }
 
     private TestHelper() {
+
+    }
+
+    private static PersistenceClient mysql_db() throws IOException {
+        BasicDataSource dataSource = new BasicDataSource();
+        dataSource.setDriverClassName("com.mysql.jdbc.Driver");
+        dataSource.setUrl("jdbc:mysql://localhost:3306/kustvakt_test");
+        dataSource.setUsername("mhanl");
+        dataSource.setPassword("password");
+        JDBCClient client = new JDBCClient(dataSource);
+        client.setDatabase("mariadb");
+
+        Flyway fl = new Flyway();
+        fl.setDataSource(dataSource);
+        fl.setLocations("db.mysql");
+        fl.migrate();
+
+        return client;
+    }
+
+    private static PersistenceClient sqlite_db(Class testclass, boolean memory)
+            throws InterruptedException {
+        SingleConnectionDataSource dataSource = new SingleConnectionDataSource();
+        dataSource.setDriverClassName("org.sqlite.JDBC");
+        DateTime t = new DateTime();
+        String name = testclass != null ? testclass.getSimpleName() + "_" : "";
+
+        if (memory)
+            dataSource.setUrl("jdbc:sqlite::memory:");
+        else {
+            File tmp = new File("tmp");
+            if (!tmp.exists())
+                tmp.mkdirs();
+            dataSource.setUrl("jdbc:sqlite:tmp/sqlite_" + name +
+                    t.getMillis() + ".sqlite");
+        }
+        dataSource.setSuppressClose(true);
+
+        Flyway fl = new Flyway();
+        fl.setDataSource(dataSource);
+        fl.setLocations("db.sqlite");
+        fl.migrate();
+
+        JDBCClient client = new JDBCClient(dataSource);
+        client.setDatabase("sqlite");
+        return client;
+    }
+
+    public static PersistenceClient sqlite_db_norm(boolean memory) {
+        BasicDataSource dataSource = new BasicDataSource();
+        dataSource.setDriverClassName("org.sqlite.JDBC");
+        dataSource.setMaxTotal(1);
+        dataSource.setInitialSize(1);
+        dataSource.setMaxIdle(1);
+        dataSource.addConnectionProperty("lazy-init", "true");
+        DateTime t = new DateTime();
+        if (memory)
+            dataSource.setUrl("jdbc:sqlite::memory:");
+        else {
+            File tmp = new File("tmp");
+            if (!tmp.exists())
+                tmp.mkdirs();
+            dataSource.setUrl("jdbc:sqlite:tmp/sqlite_" + t.toString());
+        }
+
+        Flyway fl = new Flyway();
+        fl.setDataSource(dataSource);
+        fl.setLocations("db.sqlite");
+        fl.migrate();
+
+        JDBCClient client = new JDBCClient(dataSource);
+        client.setDatabase("sqlite");
+        return client;
+    }
+
+    public static PersistenceClient h2_emb() throws SQLException {
+        BasicDataSource dataSource = new BasicDataSource();
+        dataSource.setUrl("jdbc:h2:mem:");
+        dataSource.getConnection().nativeSQL("SET MODE MySQL;");
+        dataSource.getConnection().commit();
+        dataSource.setUsername("sa");
+        dataSource.setPassword("");
+        dataSource.setDriverClassName("org.h2.Driver");
+
+        Flyway fl = new Flyway();
+        fl.setDataSource(dataSource);
+        fl.setLocations("db.mysql");
+        fl.migrate();
+        JDBCClient client = new JDBCClient(dataSource);
+        client.setDatabase("h2");
+        return client;
+    }
+
+    public static class AppTestConfig extends TestBeans {
+
+        public AppTestConfig() throws InterruptedException, IOException {
+            this.dataSource = TestHelper.sqlite_db(TestHelper.clazz, false);
+            //this.dataSource = TestHelper.mysql_db();
+        }
+
+        @Bean(name = ContextHolder.KUSTVAKT_POLICIES)
+        @Override
+        public PolicyHandlerIface getPolicyDao() {
+            return new PolicyDao(this.dataSource);
+        }
+
+        @Bean(name = ContextHolder.KUSTVAKT_USERDB)
+        @Override
+        public EntityHandlerIface getUserDao() {
+            return new EntityDao(this.dataSource);
+        }
+
+        @Bean(name = ContextHolder.KUSTVAKT_CONFIG)
+        @Override
+        public KustvaktConfiguration getConfig() {
+            KustvaktConfiguration c = new KustvaktConfiguration();
+            InputStream s = TestHelper.class.getClassLoader()
+                    .getResourceAsStream("kustvakt.conf");
+            if (s != null)
+                c.setPropertiesAsStream(s);
+            else {
+                System.out.println("No properties found!");
+                System.exit(-1);
+            }
+            return c;
+        }
+
+        @Bean(name = ContextHolder.KUSTVAKT_AUDITING)
+        @Override
+        public AuditingIface getAuditingDao() {
+            return new JDBCAuditing(this.dataSource);
+        }
+
+        @Bean(name = ContextHolder.KUSTVAKT_RESOURCES)
+        @Override
+        public List<ResourceOperationIface> getResourceDaos() {
+            List<ResourceOperationIface> res = new ArrayList<>();
+            res.add(new ResourceDao(getDataSource()));
+            res.add(new DocumentDao(getDataSource()));
+            return res;
+        }
+
+        @Bean(name = ContextHolder.KUSTVAKT_USERDATA)
+        @Override
+        public List<UserDataDbIface> getUserdataDaos() {
+            List<UserDataDbIface> ud = new ArrayList<>();
+            ud.add(new UserSettingsDao(getDataSource()));
+            ud.add(new UserDetailsDao(getDataSource()));
+            return ud;
+        }
+
+        @Bean(name = ContextHolder.KUSTVAKT_ENCRYPTION)
+        @Override
+        public EncryptionIface getCrypto() {
+            return new KustvaktEncryption(getConfig());
+        }
+
+        @Bean(name = ContextHolder.KUSTVAKT_AUTHENTICATION_MANAGER)
+        @Override
+        public AuthenticationManagerIface getAuthManager() {
+            AuthenticationManagerIface manager = new KustvaktAuthenticationManager(
+                    getUserDao(), getCrypto(), getConfig(), getAuditingDao(),
+                    getUserdataDaos());
+            Set<AuthenticationIface> pro = new HashSet<>();
+            pro.add(new BasicHttpAuth());
+            pro.add(new APIAuthentication(getConfig()));
+            manager.setProviders(pro);
+            return manager;
+        }
+
     }
 
 }
diff --git a/src/test/java/de/ids_mannheim/korap/config/UserLoaderTest.java b/src/test/java/de/ids_mannheim/korap/config/UserLoaderTest.java
index c9c4b17..4e28c4d 100644
--- a/src/test/java/de/ids_mannheim/korap/config/UserLoaderTest.java
+++ b/src/test/java/de/ids_mannheim/korap/config/UserLoaderTest.java
@@ -3,41 +3,33 @@
 import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.handlers.EntityDao;
 import de.ids_mannheim.korap.web.service.UserLoader;
-import org.junit.AfterClass;
 import org.junit.Assert;
-import org.junit.BeforeClass;
 import org.junit.Test;
 
 /**
  * @author hanl
  * @date 11/02/2016
  */
-public class UserLoaderTest {
-
-    @AfterClass
-    public static void close() {
-        BeanConfiguration.closeApplication();
-    }
-
-    @BeforeClass
-    public static void create() {
-        BeanConfiguration.loadClasspathContext("default-config.xml");
-    }
+public class UserLoaderTest extends BeanConfigTest {
 
     @Test
     public void testUserLoader() {
-        EntityDao dao = new EntityDao(
-                BeanConfiguration.getBeans().getPersistenceClient());
+        EntityDao dao = new EntityDao(helper().getContext().getPersistenceClient());
 
         boolean error = false;
         UserLoader l = new UserLoader();
         try {
-            l.load();
+            l.load(helper().getContext());
         }catch (KustvaktException e) {
             e.printStackTrace();
             error = true;
         }
-        assert !error;
+        Assert.assertFalse(error);
         Assert.assertNotEquals("Is not supposed to be zero", 0, dao.size());
     }
+
+    @Override
+    public void initMethod() throws KustvaktException {
+
+    }
 }
diff --git a/src/test/java/de/ids_mannheim/korap/handlers/DocumentDaoTest.java b/src/test/java/de/ids_mannheim/korap/handlers/DocumentDaoTest.java
index 603aa53..9a13eb4 100644
--- a/src/test/java/de/ids_mannheim/korap/handlers/DocumentDaoTest.java
+++ b/src/test/java/de/ids_mannheim/korap/handlers/DocumentDaoTest.java
@@ -1,8 +1,11 @@
-import de.ids_mannheim.korap.config.BeanConfiguration;
+package de.ids_mannheim.korap.handlers;
+
+import de.ids_mannheim.korap.config.BeanConfigTest;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
-import de.ids_mannheim.korap.handlers.DocumentDao;
 import de.ids_mannheim.korap.resources.Document;
-import org.junit.*;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Test;
 
 import java.util.List;
 
@@ -10,29 +13,13 @@
  * @author hanl
  * @date 12/11/2015
  */
-public class DocumentDaoTest {
+public class DocumentDaoTest extends BeanConfigTest {
 
     private static DocumentDao dao;
 
-    @BeforeClass
-    public static void setup() {
-        BeanConfiguration.loadClasspathContext("default-config.xml");
-        dao = new DocumentDao(
-                BeanConfiguration.getBeans().getPersistenceClient());
-    }
-
-    @AfterClass
-    public static void close() {
-        BeanConfiguration.closeApplication();
-    }
-
     @After
     public void clear() {
-        try {
-            dao.deleteAll();
-        }catch (KustvaktException e) {
-            e.printStackTrace();
-        }
+        dao.truncate();
     }
 
     @Test
@@ -109,4 +96,9 @@
         Assert.assertNotSame("should not be empty", 0, dc.size());
         Assert.assertEquals("not all found", length, dc.size());
     }
+
+    @Override
+    public void initMethod() throws KustvaktException {
+        dao = new DocumentDao(helper().getContext().getPersistenceClient());
+    }
 }
diff --git a/src/test/java/de/ids_mannheim/korap/handlers/ResourceDaoTest.java b/src/test/java/de/ids_mannheim/korap/handlers/ResourceDaoTest.java
index 83d6de7..20825a7 100644
--- a/src/test/java/de/ids_mannheim/korap/handlers/ResourceDaoTest.java
+++ b/src/test/java/de/ids_mannheim/korap/handlers/ResourceDaoTest.java
@@ -1,45 +1,81 @@
 package de.ids_mannheim.korap.handlers;
 
-import de.ids_mannheim.korap.config.BeanConfiguration;
+import de.ids_mannheim.korap.config.BeanConfigTest;
+import de.ids_mannheim.korap.config.KustvaktClassLoader;
 import de.ids_mannheim.korap.config.TestHelper;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.resources.KustvaktResource;
 import de.ids_mannheim.korap.resources.VirtualCollection;
 import de.ids_mannheim.korap.user.User;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
+import org.junit.Assert;
 import org.junit.Test;
 
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import static org.junit.Assert.*;
+import static org.junit.Assert.assertNotEquals;
+
 /**
  * @author hanl
  * @date 26/01/2016
  */
-public class ResourceDaoTest {
+public class ResourceDaoTest extends BeanConfigTest {
 
-    @BeforeClass
-    public static void init() {
-        BeanConfiguration.loadClasspathContext("default-config.xml");
-        TestHelper.setupAccount();
+    private static List<Integer> ids = new ArrayList<>();
+
+    @Override
+    public void initMethod() {
+        helper().setupAccount();
+
+        List classes = new ArrayList<>(
+                KustvaktClassLoader.loadSubTypes(KustvaktResource.class));
+        int size = classes.size();
+        for (int i = 0; i < size; i++) {
+            Class s = (Class) classes.get(i < classes.size() ? i : 0);
+            try {
+                KustvaktResource r = (KustvaktResource) s.newInstance();
+                r.setName("resource_" + i);
+                r.setPersistentID(r.getName());
+                int id = helper().setupResource(r);
+                ids.add(id);
+                assertNotEquals(0,
+                        new ResourceDao<>(helper().getContext().getPersistenceClient())
+                                .size());
+            }catch (InstantiationException e) {
+                if (i < classes.size())
+                    classes.remove(i);
+            }catch (KustvaktException | IllegalAccessException e) {
+                e.printStackTrace();
+            }
+        }
     }
 
-    @AfterClass
-    public static void drop() {
-        //        TestHelper.dropUser();
-        BeanConfiguration.closeApplication();
+    @Test
+    public void testBatchGetResources() throws KustvaktException {
+        ResourceDao dao = new ResourceDao(helper().getContext().getPersistenceClient());
+        assertNotEquals(0, dao.size());
+        Collection res = dao.getResources(ids, User.UserFactory.getDemoUser());
+        assertEquals(ids.size(), res.size());
     }
 
-    @After
-    public void clear() throws KustvaktException {
-        new ResourceDao<>(BeanConfiguration.getBeans().getPersistenceClient())
-                .deleteAll();
+    @Test
+    public void testGetResource() throws KustvaktException {
+        ResourceDao dao = new ResourceDao(helper().getContext().getPersistenceClient());
+        assertEquals("sqlite",
+                helper().getContext().getPersistenceClient().getDatabase());
+
+        assertNotEquals(0, dao.size());
+        KustvaktResource res = dao
+                .findbyId(ids.get(0), User.UserFactory.getDemoUser());
+        assertNotNull(res);
     }
 
     @Test
     public void createCollection() throws KustvaktException {
-        ResourceDao dao = new ResourceDao(
-                BeanConfiguration.getBeans().getPersistenceClient());
-        VirtualCollection c = new VirtualCollection("testColl");
+        ResourceDao dao = new ResourceDao(helper().getContext().getPersistenceClient());
+        VirtualCollection c = new VirtualCollection("testColl1");
         c.addField("key_1", "this is a test");
         c.addField("key_2", 2);
 
@@ -49,17 +85,16 @@
         int id = dao.storeResource(c, user);
 
         KustvaktResource r = dao.findbyId(id, user);
-        assert dao.size() > 0;
-        assert r != null;
-        assert r.getField("key_1") instanceof String;
-        assert r.getField("key_2") instanceof Integer;
+        assertNotEquals(dao.size(),0);
+        assertNotNull(r);
+        assertEquals(r.getField("key_1") instanceof String,true);
+        assertEquals(r.getField("key_2") instanceof Integer,true);
     }
 
     @Test
     public void ResourceDataUpdate() throws KustvaktException {
-        ResourceDao dao = new ResourceDao(
-                BeanConfiguration.getBeans().getPersistenceClient());
-        VirtualCollection c = new VirtualCollection("testColl");
+        ResourceDao dao = new ResourceDao(helper().getContext().getPersistenceClient());
+        VirtualCollection c = new VirtualCollection("testColl2");
         c.addField("key_1", "this is a test");
         c.addField("key_2", 2);
 
diff --git a/src/test/java/de/ids_mannheim/korap/handlers/UserDaoTest.java b/src/test/java/de/ids_mannheim/korap/handlers/UserDaoTest.java
index 94abd81..0c9be7c 100644
--- a/src/test/java/de/ids_mannheim/korap/handlers/UserDaoTest.java
+++ b/src/test/java/de/ids_mannheim/korap/handlers/UserDaoTest.java
@@ -1,95 +1,98 @@
-import de.ids_mannheim.korap.config.BeanConfiguration;
+package de.ids_mannheim.korap.handlers;
+
+import de.ids_mannheim.korap.config.BeanConfigTest;
+import de.ids_mannheim.korap.config.BeansFactory;
 import de.ids_mannheim.korap.config.TestHelper;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.interfaces.db.EntityHandlerIface;
 import de.ids_mannheim.korap.interfaces.db.UserDataDbIface;
-import de.ids_mannheim.korap.user.*;
-import org.junit.AfterClass;
-import org.junit.Assert;
-import org.junit.BeforeClass;
+import de.ids_mannheim.korap.user.User;
+import de.ids_mannheim.korap.user.UserDetails;
+import de.ids_mannheim.korap.user.UserSettings;
+import de.ids_mannheim.korap.user.Userdata;
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+
 ;
 
 /**
  * @author hanl
  * @date 13/02/2015
  */
-public class UserDaoTest {
-
-    @BeforeClass
-    public static void create() {
-        BeanConfiguration.loadClasspathContext("default-config.xml");
-        TestHelper.setupAccount();
-        TestHelper.runBootInterfaces();
-    }
-
-    @AfterClass
-    public static void close() {
-        assert TestHelper.dropUser();
-        BeanConfiguration.closeApplication();
-    }
+public class UserDaoTest extends BeanConfigTest {
 
     @Test
     public void userput() throws KustvaktException {
-        User user1 = BeanConfiguration.getBeans().getUserDBHandler()
+        User user1 = helper().getContext().getUserDBHandler()
                 .getAccount(TestHelper.getUserCredentials()[0]);
-        Assert.assertEquals("user creation failed", true, user1.getId() != -1);
+        assertEquals("user creation failed", true, user1.getId() != -1);
+    }
+
+    @Test
+    public void userputBatch() {
+        //todo:
     }
 
     @Test
     public void userget() throws KustvaktException {
-        User user1 = BeanConfiguration.getBeans().getUserDBHandler()
+        User user1 = helper().getContext().getUserDBHandler()
                 .getAccount(TestHelper.getUserCredentials()[0]);
-        Assert.assertEquals("User Retrieval does not work",
+        assertEquals("User Retrieval does not work",
                 TestHelper.getUserCredentials()[0], user1.getUsername());
     }
 
     //    @Test
     public void testUserdetailsGetNonExistent() throws KustvaktException {
-        TestHelper.setupSimpleAccount("userdbtest", "userdbTest");
-        User user = BeanConfiguration.getBeans().getUserDBHandler()
+        helper().setupSimpleAccount("userdbtest", "userdbTest");
+        User user = helper().getContext().getUserDBHandler()
                 .getAccount("userdbtest");
-        UserDataDbIface dao = UserdataFactory.getDaoInstance(UserDetails.class);
+        UserDataDbIface dao = BeansFactory.getTypeFactory().getTypedBean(helper()
+                .getContext().getUserDataDaos(), UserDetails.class);
         Userdata data = dao.get(user);
-        assert data == null;
-        TestHelper.dropUser("userdbtest");
+        assertNull(data);
+        helper().dropUser("userdbtest");
     }
 
     //    @Test
     public void testUserSettingsGetNonExistent() throws KustvaktException {
-        TestHelper.setupSimpleAccount("userdbtest", "userdbTest");
-        User user = BeanConfiguration.getBeans().getUserDBHandler()
+        helper().setupSimpleAccount("userdbtest", "userdbTest");
+        User user = helper().getContext().getUserDBHandler()
                 .getAccount("userdbtest");
-        UserDataDbIface dao = UserdataFactory
-                .getDaoInstance(UserSettings.class);
+        UserDataDbIface dao = BeansFactory.getTypeFactory().getTypedBean(helper()
+                .getContext().getUserDataDaos(), UserSettings.class);
         Userdata data = dao.get(user);
-        assert data == null;
-        TestHelper.dropUser("userdbtest");
+        assertNull(data);
+        helper().dropUser("userdbtest");
 
     }
 
     // username cannot currently be changed
     //    @Test
     public void updateUsername() throws KustvaktException {
-        User user1 = BeanConfiguration.getBeans().getUserDBHandler()
+        User user1 = helper().getContext().getUserDBHandler()
                 .getAccount(TestHelper.getUserCredentials()[0]);
         user1.setUsername("new_user");
-        BeanConfiguration.getBeans().getUserDBHandler().updateAccount(user1);
-        User u2 = BeanConfiguration.getBeans().getUserDBHandler()
+        helper().getContext().getUserDBHandler().updateAccount(user1);
+        User u2 = helper().getContext().getUserDBHandler()
                 .getAccount("new_user");
-        Assert.assertEquals("not found", user1.getUsername(), u2.getUsername());
+        assertEquals("not found", user1.getUsername(), u2.getUsername());
     }
 
     @Test
     public void userupdate() throws KustvaktException {
-        EntityHandlerIface dao = BeanConfiguration.getBeans()
-                .getUserDBHandler();
+        EntityHandlerIface dao = helper().getContext().getUserDBHandler();
         User user1 = dao.getAccount(TestHelper.getUserCredentials()[0]);
         user1.setAccountLocked(true);
         dao.updateAccount(user1);
-        Assert.assertEquals("not valid", true,
+        assertEquals("not valid", true,
                 dao.getAccount(user1.getUsername()).isAccountLocked());
     }
 
+    @Override
+    public void initMethod() throws KustvaktException {
+        helper().setupAccount();
+        helper().runBootInterfaces();
+    }
 }
diff --git a/src/test/java/de/ids_mannheim/korap/resource/rewrite/CollectionRewriteTest.java b/src/test/java/de/ids_mannheim/korap/resource/rewrite/CollectionRewriteTest.java
index 2db2838..6574d09 100644
--- a/src/test/java/de/ids_mannheim/korap/resource/rewrite/CollectionRewriteTest.java
+++ b/src/test/java/de/ids_mannheim/korap/resource/rewrite/CollectionRewriteTest.java
@@ -1,39 +1,34 @@
+package de.ids_mannheim.korap.resource.rewrite;
+
 import com.fasterxml.jackson.databind.JsonNode;
-import de.ids_mannheim.korap.config.BeanConfiguration;
+import de.ids_mannheim.korap.config.BeanConfigTest;
 import de.ids_mannheim.korap.config.KustvaktConfiguration;
+import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.query.serialize.QuerySerializer;
-import de.ids_mannheim.korap.resource.rewrite.CollectionCleanupFilter;
-import de.ids_mannheim.korap.resource.rewrite.CollectionConstraint;
-import de.ids_mannheim.korap.resource.rewrite.RewriteHandler;
 import de.ids_mannheim.korap.user.User;
 import de.ids_mannheim.korap.utils.JsonUtils;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
+import org.junit.Assert;
 import org.junit.Test;
 
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
 /**
  * @author hanl
  * @date 03/09/2015
  */
-// todo: 20.10.15
-public class CollectionRewriteTest {
+public class CollectionRewriteTest extends BeanConfigTest {
 
     private static String simple_add_query = "[pos=ADJA]";
 
     private static KustvaktConfiguration config;
 
-    @BeforeClass
-    public static void init() {
-        BeanConfiguration.loadClasspathContext("default-config.xml");
-        config = BeanConfiguration.getBeans().getConfiguration();
-    }
-
-    @AfterClass
-    public static void close() {
-        BeanConfiguration.closeApplication();
+    @Override
+    public void initMethod() throws KustvaktException {
+        config = helper().getContext().getConfiguration();
     }
 
     @Deprecated
@@ -50,7 +45,8 @@
 
     @Test
     public void testCollectionNodeRemoveCorpusIdNoErrors() {
-        RewriteHandler handler = new RewriteHandler(config);
+        RewriteHandler handler = new RewriteHandler();
+        handler.insertBeans(helper().getContext());
         handler.add(CollectionConstraint.class);
         QuerySerializer s = new QuerySerializer();
         s.setQuery(simple_add_query, "poliqarp");
@@ -58,13 +54,14 @@
         String result = s.toJSON();
         JsonNode node = JsonUtils.readTree(handler.preProcess(result,
                 User.UserFactory.getUser("test_user")));
-        assert node != null;
-        assert node.at("/collection/operands").size() == 1;
+        assertNotNull(node);
+        assertEquals(1, node.at("/collection/operands").size());
     }
 
     @Test
     public void testCollectionNodeRemoveAllCorpusIdNoErrors() {
-        RewriteHandler handler = new RewriteHandler(config);
+        RewriteHandler handler = new RewriteHandler();
+        handler.insertBeans(helper().getContext());
         handler.add(CollectionConstraint.class);
         QuerySerializer s = new QuerySerializer();
         s.setQuery(simple_add_query, "poliqarp");
@@ -73,13 +70,14 @@
         JsonNode node = JsonUtils.readTree(handler.preProcess(result,
                 User.UserFactory.getUser("test_user")));
         //        System.out.println("RESULTING REWR NODE " + node);
-        assert node != null;
-        assert node.at("/collection/operands").size() == 0;
+        assertNotNull(node);
+        assertEquals(0, node.at("/collection/operands").size());
     }
 
     @Test
     public void testCollectionNodeRemoveGroupedCorpusIdNoErrors() {
-        RewriteHandler handler = new RewriteHandler(config);
+        RewriteHandler handler = new RewriteHandler();
+        handler.insertBeans(helper().getContext());
         handler.add(CollectionConstraint.class);
         QuerySerializer s = new QuerySerializer();
         s.setQuery(simple_add_query, "poliqarp");
@@ -89,17 +87,16 @@
         JsonNode node = JsonUtils.readTree(handler.preProcess(result,
                 User.UserFactory.getUser("test_user")));
 
-        assert node != null;
-        assert node.at("/collection/operands/0/@type").asText()
-                .equals("koral:docGroup");
-        assert node.at("/collection/operands/0/operands/0/key").asText()
-                .equals("textClass");
+        assertNotNull(node);
+        assertEquals("koral:docGroup",node.at("/collection/operands/0/@type").asText());
+        assertEquals("textClass",node.at("/collection/operands/0/operands/0/key").asText());
     }
 
     //fixme: will probably fail when one doc groups are being refactored
     @Test
     public void testCollectionCleanEmptyDocGroupNoErrors() {
-        RewriteHandler handler = new RewriteHandler(config);
+        RewriteHandler handler = new RewriteHandler();
+        handler.insertBeans(helper().getContext());
         handler.add(CollectionConstraint.class);
         handler.add(CollectionCleanupFilter.class);
         QuerySerializer s = new QuerySerializer();
@@ -110,18 +107,18 @@
         JsonNode node = JsonUtils.readTree(handler.preProcess(result,
                 User.UserFactory.getUser("test_user")));
 
-        assert node != null;
-        assert node.at("/collection/@type").asText().equals("koral:docGroup");
-        assert node.at("/collection/operands").size() == 2;
-        assert node.at("/collection/operands/0/key").asText()
-                .equals("textClass");
-        assert node.at("/collection/operands/1/key").asText()
-                .equals("textClass");
+        assertNotNull(node);
+        assertEquals("koral:docGroup",node.at("/collection/@type").asText());
+        assertEquals(2,node.at("/collection/operands").size());
+
+        assertEquals("textClass",node.at("/collection/operands/0/key").asText());
+        assertEquals("textClass",node.at("/collection/operands/1/key").asText());
     }
 
     @Test
     public void testCollectionCleanMoveOneDocFromGroupUpNoErrors() {
-        RewriteHandler handler = new RewriteHandler(config);
+        RewriteHandler handler = new RewriteHandler();
+        handler.insertBeans(helper().getContext());
         handler.add(CollectionConstraint.class);
         handler.add(CollectionCleanupFilter.class);
         QuerySerializer s = new QuerySerializer();
@@ -130,13 +127,14 @@
         String result = s.toJSON();
         JsonNode node = JsonUtils.readTree(handler.preProcess(result,
                 User.UserFactory.getUser("test_user")));
-        assert node != null;
-        assert node.at("/collection/@type").asText().equals("koral:doc");
+        assertNotNull(node);
+        assertEquals("koral:doc",node.at("/collection/@type").asText());
     }
 
     @Test
     public void testCollectionCleanEmptyGroupAndMoveOneFromGroupUpNoErrors() {
-        RewriteHandler handler = new RewriteHandler(config);
+        RewriteHandler handler = new RewriteHandler();
+        handler.insertBeans(helper().getContext());
         handler.add(CollectionConstraint.class);
         handler.add(CollectionCleanupFilter.class);
         QuerySerializer s = new QuerySerializer();
@@ -147,30 +145,31 @@
         JsonNode node = JsonUtils.readTree(handler.preProcess(result,
                 User.UserFactory.getUser("test_user")));
 
-        assert node != null;
-        assert node.at("/collection/@type").asText().equals("koral:doc");
-        assert node.at("/collection/key").asText().equals("textClass");
+        assertNotNull(node);
+        assertEquals("koral:doc",node.at("/collection/@type").asText());
+        assertEquals("textClass",node.at("/collection/key").asText());
     }
 
     @Test
     public void testCollectionRemoveAndMoveOneFromGroupUpNoErrors() {
-        RewriteHandler handler = new RewriteHandler(config);
+        RewriteHandler handler = new RewriteHandler();
+        handler.insertBeans(helper().getContext());
         handler.add(CollectionConstraint.class);
         handler.add(CollectionCleanupFilter.class);
         QuerySerializer s = new QuerySerializer();
         s.setQuery(simple_add_query, "poliqarp");
         s.setCollection(
                 "(docID=random & textClass=Wissenschaft) & corpusID=WPD");
-        String result = s.toJSON();
-        JsonNode node = JsonUtils.readTree(handler.preProcess(result,
+        String org = s.toJSON();
+        JsonNode node = JsonUtils.readTree(handler.preProcess(org,
                 User.UserFactory.getUser("test_user")));
-        System.out.println("original node " + result);
-        System.out.println("result node " + node);
-        assert node != null;
-        assert node.at("/collection/@type").asText().equals("koral:docGroup");
-        assert node.at("/collection/operands").size() == 2;
-        assert node.at("/collection/operands/0/@type").asText()
-                .equals("koral:doc");
+
+        assertNotNull(node);
+        assertEquals("koral:docGroup",node.at("/collection/@type").asText());
+        assertEquals(2, node.at("/collection/operands").size());
+        assertEquals("koral:doc",node.at("/collection/operands/0/@type").asText());
     }
 
+
+
 }
diff --git a/src/test/java/de/ids_mannheim/korap/resource/rewrite/FoundryRewriteTest.java b/src/test/java/de/ids_mannheim/korap/resource/rewrite/FoundryRewriteTest.java
index 1a477d9..0cbd369 100644
--- a/src/test/java/de/ids_mannheim/korap/resource/rewrite/FoundryRewriteTest.java
+++ b/src/test/java/de/ids_mannheim/korap/resource/rewrite/FoundryRewriteTest.java
@@ -1,21 +1,28 @@
+package de.ids_mannheim.korap.resource.rewrite;
+
 import com.fasterxml.jackson.databind.JsonNode;
-import de.ids_mannheim.korap.config.BeanConfiguration;
+import de.ids_mannheim.korap.config.BeanConfigTest;
+import de.ids_mannheim.korap.config.BeansFactory;
+import de.ids_mannheim.korap.config.ContextHolder;
 import de.ids_mannheim.korap.config.KustvaktConfiguration;
+import de.ids_mannheim.korap.exceptions.KustvaktException;
+import de.ids_mannheim.korap.interfaces.db.UserDataDbIface;
 import de.ids_mannheim.korap.query.serialize.QuerySerializer;
 import de.ids_mannheim.korap.resource.LayerMapper;
-import de.ids_mannheim.korap.resource.rewrite.FoundryInject;
-import de.ids_mannheim.korap.resource.rewrite.RewriteHandler;
+import de.ids_mannheim.korap.user.Attributes;
+import de.ids_mannheim.korap.user.User;
+import de.ids_mannheim.korap.user.UserSettings;
 import de.ids_mannheim.korap.utils.JsonUtils;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
 import org.junit.Test;
 
+import static org.junit.Assert.*;
+
 /**
  * @author hanl
  * @date 18/06/2015
  */
 //todo: refactor and structure tests
-public class FoundryRewriteTest {
+public class FoundryRewriteTest extends BeanConfigTest {
 
     private static String simple_add_query = "[pos=ADJA]";
     private static String simple_rewrite_query = "[base=Haus]";
@@ -25,96 +32,174 @@
 
     private static KustvaktConfiguration config;
 
-    @BeforeClass
-    public static void init() {
-        BeanConfiguration.loadClasspathContext();
-        config = BeanConfiguration.getBeans().getConfiguration();
-    }
-
-    @AfterClass
-    public static void close() {
-        BeanConfiguration.closeApplication();
-    }
-
-    @Test
-    public void testSimpleFoundryAddThrowsNoError() {
-        RewriteHandler processor = new RewriteHandler(config);
-        processor.add(FoundryInject.class);
-        QuerySerializer s = new QuerySerializer();
-        s.setQuery(simple_add_query, "poliqarp");
-        String result = processor.preProcess(s.toJSON(), null);
-        JsonNode node = JsonUtils.readTree(result);
-
-        assert node != null;
-        assert !node.at("/query/wrap/foundry").isMissingNode();
+    @Override
+    public void initMethod() throws KustvaktException {
+        config = helper().getContext().getConfiguration();
+        helper().setupAccount();
     }
 
     @Test
     public void testDefaultLayerMapperThrowsNoException() {
         LayerMapper m = new LayerMapper(config);
 
-        assert m.findFoundry("lemma").equals(config.getDefault_lemma());
-        assert m.findFoundry("pos").equals(config.getDefault_pos());
-        assert m.findFoundry("surface").equals(config.getDefault_token());
-        assert m.findFoundry("d").equals(config.getDefault_dep());
-        assert m.findFoundry("c").equals(config.getDefault_const());
+        assertEquals(config.getDefault_lemma(), m.findFoundry("lemma"));
+        assertEquals(config.getDefault_pos(), m.findFoundry("pos"));
+        assertEquals(config.getDefault_token(), m.findFoundry("surface"));
+        assertEquals(config.getDefault_dep(), m.findFoundry("d"));
+        assertEquals(config.getDefault_const(), m.findFoundry("c"));
     }
 
     @Test
-    public void testFoundryInjectPosNoErrors() {
+    public void testDefaultFoundryInjectLemmaThrowsNoError() {
+
+        KustvaktConfiguration c = helper()
+                .getBean(ContextHolder.KUSTVAKT_CONFIG);
+
+        RewriteHandler processor = new RewriteHandler();
+        processor.insertBeans(helper().getContext());
+        processor.add(FoundryInject.class);
         QuerySerializer s = new QuerySerializer();
-        RewriteHandler handler = new RewriteHandler(config);
+        s.setQuery("[base=Haus]", "poliqarp");
+        String result = processor.preProcess(s.toJSON(), null);
+        JsonNode node = JsonUtils.readTree(result);
+
+        assertNotNull(node);
+        assertFalse(node.at("/query/wrap/foundry").isMissingNode());
+        assertEquals(c.getDefault_lemma(),
+                node.at("/query/wrap/foundry").asText());
+        assertEquals("lemma", node.at("/query/wrap/layer").asText());
+        assertFalse(node.at("/query/wrap/rewrites").isMissingNode());
+        assertEquals("koral:rewrite",
+                node.at("/query/wrap/rewrites/0/@type").asText());
+    }
+
+    @Test
+    public void testDefaultFoundryInjectPOSNoErrors() {
+
+        KustvaktConfiguration c = helper()
+                .getBean(ContextHolder.KUSTVAKT_CONFIG);
+
+        QuerySerializer s = new QuerySerializer();
+        RewriteHandler handler = new RewriteHandler();
+        handler.insertBeans(helper().getContext());
         s.setQuery("[pos=ADJA]", "poliqarp");
-        assert handler.add(FoundryInject.class);
+        assertTrue(handler.add(FoundryInject.class));
         String result = handler.preProcess(s.toJSON(), null);
         JsonNode node = JsonUtils.readTree(result);
 
-        assert node != null;
-        assert !node.at("/query/wrap/foundry").isMissingNode();
-        assert !node.at("/query/wrap/rewrites").isMissingNode();
-        assert node.at("/query/wrap/rewrites/0/@type").asText()
-                .equals("koral:rewrite");
+        assertNotNull(node);
+        assertFalse(node.at("/query/wrap/foundry").isMissingNode());
+        assertEquals(c.getDefault_pos(),
+                node.at("/query/wrap/foundry").asText());
+        assertEquals("pos", node.at("/query/wrap/layer").asText());
+        assertFalse(node.at("/query/wrap/rewrites").isMissingNode());
+        assertEquals("koral:rewrite",
+                node.at("/query/wrap/rewrites/0/@type").asText());
+
+    }
+
+    @Test
+    public void testRewriteFoundryInjectPOSThrowsNoError()
+            throws KustvaktException {
+        User user = helper().getUser();
+
+        RewriteHandler handler = new RewriteHandler();
+        handler.insertBeans(helper().getContext());
+        handler.add(FoundryInject.class);
+        QuerySerializer s = new QuerySerializer();
+        s.setQuery("[pos=ADJA]", "poliqarp");
+        String result = handler.preProcess(s.toJSON(), user);
+        JsonNode node = JsonUtils.readTree(result);
+
+        UserDataDbIface dao = BeansFactory.getTypeFactory()
+                .getTypedBean(helper().getContext().getUserDataDaos(),
+                        UserSettings.class);
+        UserSettings settings = (UserSettings) dao.get(user);
+        assertTrue(settings.isValid());
+        String pos = (String) settings.get(Attributes.DEFAULT_POS_FOUNDRY);
+
+        assertNotNull(node);
+        assertEquals("pos", node.at("/query/wrap/layer").asText());
+        assertEquals(pos, node.at("/query/wrap/foundry").asText());
+        assertFalse(node.at("/query/wrap/rewrites").isMissingNode());
+        assertEquals("koral:rewrite",
+                node.at("/query/wrap/rewrites/0/@type").asText());
+    }
+
+    @Test
+    public void testRewriteFoundryInjectLemmaThrowsNoError()
+            throws KustvaktException {
+        KustvaktConfiguration c = helper()
+                .getBean(ContextHolder.KUSTVAKT_CONFIG);
+        User user = helper().getUser();
+
+        RewriteHandler handler = new RewriteHandler();
+        handler.insertBeans(helper().getContext());
+        handler.add(FoundryInject.class);
+        QuerySerializer s = new QuerySerializer();
+        s.setQuery("[base=Haus]", "poliqarp");
+        String result = handler.preProcess(s.toJSON(), user);
+        JsonNode node = JsonUtils.readTree(result);
+
+        UserDataDbIface dao = BeansFactory.getTypeFactory()
+                .getTypedBean(helper().getContext().getUserDataDaos(),
+                        UserSettings.class);
+        UserSettings settings = (UserSettings) dao.get(user);
+        assertTrue(settings.isValid());
+        String lemma = (String) settings.get(Attributes.DEFAULT_LEMMA_FOUNDRY);
+
+        assertNotNull(node);
+        assertEquals("lemma", node.at("/query/wrap/layer").asText());
+        assertEquals(lemma, node.at("/query/wrap/foundry").asText());
+        assertFalse(node.at("/query/wrap/rewrites").isMissingNode());
+        assertEquals("koral:rewrite",
+                node.at("/query/wrap/rewrites/0/@type").asText());
     }
 
     @Test
     public void testFoundryInjectJoinedQueryNoErrors() {
+        KustvaktConfiguration c = helper()
+                .getBean(ContextHolder.KUSTVAKT_CONFIG);
+
         QuerySerializer s = new QuerySerializer();
-        RewriteHandler handler = new RewriteHandler(config);
+        RewriteHandler handler = new RewriteHandler();
+        handler.insertBeans(helper().getContext());
         s.setQuery("[orth=laufe/i & base!=Lauf]", "poliqarp");
-        assert handler.add(FoundryInject.class);
+        assertTrue(handler.add(FoundryInject.class));
         String result = handler.preProcess(s.toJSON(), null);
         JsonNode node = JsonUtils.readTree(result);
 
-        assert node != null;
-        assert node.at("/query/wrap/@type").asText().equals("koral:termGroup");
-        assert !node.at("/query/wrap/operands/0/foundry").isMissingNode();
-        assert !node.at("/query/wrap/operands/0/rewrites").isMissingNode();
-        assert !node.at("/query/wrap/operands/1/foundry").isMissingNode();
-        assert !node.at("/query/wrap/operands/1/rewrites").isMissingNode();
+        assertNotNull(node);
+        assertEquals("koral:termGroup", node.at("/query/wrap/@type").asText());
+        assertFalse(node.at("/query/wrap/operands/0/foundry").isMissingNode());
+        assertFalse(node.at("/query/wrap/operands/0/rewrites").isMissingNode());
+        assertFalse(node.at("/query/wrap/operands/1/foundry").isMissingNode());
+        assertFalse(node.at("/query/wrap/operands/1/rewrites").isMissingNode());
     }
 
     @Test
     public void testFoundryInjectGroupedQueryNoErrors() {
         QuerySerializer s = new QuerySerializer();
-        RewriteHandler handler = new RewriteHandler(config);
+        RewriteHandler handler = new RewriteHandler();
+        handler.insertBeans(helper().getContext());
         s.setQuery("[(base=laufen | base=gehen) & tt/pos=VVFIN]", "poliqarp");
-        assert handler.add(FoundryInject.class);
+        assertTrue(handler.add(FoundryInject.class));
         String result = handler.preProcess(s.toJSON(), null);
         JsonNode node = JsonUtils.readTree(result);
 
-        assert node != null;
-        assert node.at("/query/wrap/@type").asText().equals("koral:termGroup");
-        assert !node.at("/query/wrap/operands/0/operands/0/foundry")
-                .isMissingNode();
-        assert !node.at("/query/wrap/operands/0/operands/0/rewrites")
-                .isMissingNode();
-        assert !node.at("/query/wrap/operands/0/operands/1/foundry")
-                .isMissingNode();
-        assert !node.at("/query/wrap/operands/0/operands/1/rewrites")
-                .isMissingNode();
+        assertNotNull(node);
+        assertEquals("koral:termGroup", node.at("/query/wrap/@type").asText());
+        assertFalse(node.at("/query/wrap/operands/0/operands/0/foundry")
+                .isMissingNode());
+        assertFalse(node.at("/query/wrap/operands/0/operands/0/rewrites")
+                .isMissingNode());
+        assertFalse(node.at("/query/wrap/operands/0/operands/1/foundry")
+                .isMissingNode());
+        assertFalse(node.at("/query/wrap/operands/0/operands/1/rewrites")
+                .isMissingNode());
 
-        assert !node.at("/query/wrap/operands/1/foundry").isMissingNode();
-        assert node.at("/query/wrap/operands/1/rewrites").isMissingNode();
+        assertFalse(node.at("/query/wrap/operands/1/foundry").isMissingNode());
+        assertTrue(node.at("/query/wrap/operands/1/rewrites").isMissingNode());
     }
 
 }
diff --git a/src/test/java/de/ids_mannheim/korap/resource/rewrite/IdRewriteTest.java b/src/test/java/de/ids_mannheim/korap/resource/rewrite/IdRewriteTest.java
index 6c0b8c4..09be840 100644
--- a/src/test/java/de/ids_mannheim/korap/resource/rewrite/IdRewriteTest.java
+++ b/src/test/java/de/ids_mannheim/korap/resource/rewrite/IdRewriteTest.java
@@ -1,34 +1,25 @@
+package de.ids_mannheim.korap.resource.rewrite;
+
 import com.fasterxml.jackson.databind.JsonNode;
-import de.ids_mannheim.korap.config.BeanConfiguration;
+import de.ids_mannheim.korap.config.BeanConfigTest;
+import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.query.serialize.QuerySerializer;
-import de.ids_mannheim.korap.resource.rewrite.IdWriter;
-import de.ids_mannheim.korap.resource.rewrite.RewriteHandler;
 import de.ids_mannheim.korap.utils.JsonUtils;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
 import org.junit.Test;
 
+import static org.junit.Assert.*;
+
 /**
  * @author hanl
  * @date 21/10/2015
  */
-public class IdRewriteTest {
-
-    @BeforeClass
-    public static void setup() {
-        BeanConfiguration.loadClasspathContext();
-    }
-
-    @AfterClass
-    public static void close() {
-        BeanConfiguration.closeApplication();
-    }
+public class IdRewriteTest extends BeanConfigTest {
 
     @Test
     public void insertTokenId() {
-        RewriteHandler handler = new RewriteHandler(
-                BeanConfiguration.getBeans().getConfiguration());
-        assert handler.add(IdWriter.class);
+        RewriteHandler handler = new RewriteHandler();
+        handler.insertBeans(helper().getContext());
+        assertTrue(handler.add(IdWriter.class));
 
         String query = "[surface=Wort]";
         QuerySerializer s = new QuerySerializer();
@@ -37,9 +28,27 @@
         String value = handler.preProcess(s.toJSON(), null);
         JsonNode result = JsonUtils.readTree(value);
 
-        assert result != null;
-        assert result.path("query").has("idn");
-
+        assertNotNull(result);
+        assertTrue(result.path("query").has("idn"));
     }
 
+    @Test
+    public void testIdWriterTest() {
+        RewriteHandler handler = new RewriteHandler();
+        handler.insertBeans(helper().getContext());
+        assertTrue(handler.add(IdWriter.class));
+
+        QuerySerializer s = new QuerySerializer();
+        s.setQuery("[base=Haus]", "poliqarp");
+        String result = handler.preProcess(s.toJSON(), null);
+        JsonNode node = JsonUtils.readTree(result);
+        assertNotNull(node);
+        assertFalse(node.at("/query/wrap").isMissingNode());
+        assertFalse(node.at("/query/idn").isMissingNode());
+    }
+
+    @Override
+    public void initMethod() throws KustvaktException {
+
+    }
 }
diff --git a/src/test/java/de/ids_mannheim/korap/resource/rewrite/PostRewriteTest.java b/src/test/java/de/ids_mannheim/korap/resource/rewrite/PostRewriteTest.java
index 2771a06..a3b19a0 100644
--- a/src/test/java/de/ids_mannheim/korap/resource/rewrite/PostRewriteTest.java
+++ b/src/test/java/de/ids_mannheim/korap/resource/rewrite/PostRewriteTest.java
@@ -1,80 +1,82 @@
+package de.ids_mannheim.korap.resource.rewrite;
+
 import com.fasterxml.jackson.databind.JsonNode;
-import de.ids_mannheim.korap.config.BeanConfiguration;
+import de.ids_mannheim.korap.config.BeanConfigTest;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.handlers.DocumentDao;
-import de.ids_mannheim.korap.resource.rewrite.DocMatchRewrite;
-import de.ids_mannheim.korap.resource.rewrite.RewriteHandler;
 import de.ids_mannheim.korap.resources.Document;
 import de.ids_mannheim.korap.utils.JsonUtils;
 import net.sf.ehcache.CacheManager;
-import org.junit.*;
+import org.junit.Before;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
 
 /**
  * @author hanl
  * @date 12/11/2015
  */
 //fixme: tests only work with singleconnection data sources
-public class PostRewriteTest {
+// todo: logging!
+public class PostRewriteTest extends BeanConfigTest {
 
-    @BeforeClass
-    public static void setup() {
-        BeanConfiguration.loadClasspathContext("default-config.xml");
-    }
+    @Override
+    public void initMethod() throws KustvaktException {
 
-    @AfterClass
-    public static void close() {
-        BeanConfiguration.closeApplication();
     }
 
     // otherwise cache will maintain values not relevant for other tests
     @Before
     public void before() {
         CacheManager.getInstance().getCache("documents").removeAll();
+        DocumentDao dao = new DocumentDao(
+                helper().getContext().getPersistenceClient());
+        dao.truncate();
     }
 
     @Test
-    public void testPostRewriteNothingToDo() {
-        RewriteHandler ha = new RewriteHandler(null);
-        Assert.assertEquals("Handler could not be added to rewriter instance!",
-                true, ha.add(DocMatchRewrite.class));
+    public void testPostRewriteNothingToDo() throws KustvaktException {
+        RewriteHandler ha = new RewriteHandler();
+        ha.insertBeans(helper().getContext());
+        assertEquals("Handler could not be added to rewriter instance!", true,
+                ha.add(DocMatchRewrite.class));
 
         DocumentDao dao = new DocumentDao(
-                BeanConfiguration.getBeans().getPersistenceClient());
+                helper().getContext().getPersistenceClient());
         try {
             Document d = dao.findbyId("BRZ13_APR.00014", null);
-            Assert.assertNull(d);
-        }catch (KustvaktException e) {
+            assertNull(d);
+            String v = ha.postProcess(RESULT, null);
+            assertEquals("results do not match", JsonUtils.readTree(RESULT),
+                    JsonUtils.readTree(v));
+        }catch (Exception e) {
             e.printStackTrace();
         }
-
-        String v = ha.postProcess(RESULT, null);
-        Assert.assertEquals("results do not match", JsonUtils.readTree(RESULT),
-                JsonUtils.readTree(v));
     }
 
     @Test
     public void testPostRewriteRemoveDoc() {
         DocumentDao dao = new DocumentDao(
-                BeanConfiguration.getBeans().getPersistenceClient());
+                helper().getContext().getPersistenceClient());
 
         Document doc = new Document("BRZ13_APR.00014");
         doc.setDisabled(true);
         try {
             dao.storeResource(doc, null);
         }catch (KustvaktException e) {
-            e.printStackTrace();
             return;
         }
 
-        RewriteHandler ha = new RewriteHandler(null);
-        Assert.assertEquals("Handler could not be added to rewriter instance!",
-                true, ha.add(DocMatchRewrite.class));
+        RewriteHandler ha = new RewriteHandler();
+        ha.insertBeans(helper().getContext());
+        assertEquals("Handler could not be added to rewriter instance!", true,
+                ha.add(DocMatchRewrite.class));
 
         String v = ha.postProcess(RESULT, null);
 
         JsonNode node = JsonUtils.readTree(v);
 
-        Assert.assertNotEquals("Wrong DocID", "BRZ13_APR.00014",
+        assertNotEquals("Wrong DocID", "BRZ13_APR.00014",
                 node.at("/matches/1/docID"));
 
         try {
diff --git a/src/test/java/de/ids_mannheim/korap/resource/rewrite/RewriteHandlerTest.java b/src/test/java/de/ids_mannheim/korap/resource/rewrite/RewriteHandlerTest.java
index 059329c..d41a3a2 100644
--- a/src/test/java/de/ids_mannheim/korap/resource/rewrite/RewriteHandlerTest.java
+++ b/src/test/java/de/ids_mannheim/korap/resource/rewrite/RewriteHandlerTest.java
@@ -1,76 +1,107 @@
 package de.ids_mannheim.korap.resource.rewrite;
 
 import com.fasterxml.jackson.databind.JsonNode;
-import de.ids_mannheim.korap.config.BeanConfiguration;
-import de.ids_mannheim.korap.config.KustvaktConfiguration;
-import de.ids_mannheim.korap.config.TestHelper;
+import de.ids_mannheim.korap.config.BeanConfigTest;
+import de.ids_mannheim.korap.config.BeansFactory;
+import de.ids_mannheim.korap.exceptions.KustvaktException;
+import de.ids_mannheim.korap.interfaces.db.UserDataDbIface;
 import de.ids_mannheim.korap.query.serialize.QuerySerializer;
+import de.ids_mannheim.korap.user.Attributes;
+import de.ids_mannheim.korap.user.UserSettings;
 import de.ids_mannheim.korap.utils.JsonUtils;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
 import org.junit.Test;
 
+import static org.junit.Assert.*;
+
 /**
  * @author hanl
  * @date 21/10/2015
  */
-public class RewriteHandlerTest {
-
-    @BeforeClass
-    public static void setup() {
-        BeanConfiguration.loadClasspathContext("default-config.xml");
-        TestHelper.setupAccount();
-    }
-
-    @AfterClass
-    public static void close() {
-        TestHelper.dropUser();
-        BeanConfiguration.closeApplication();
-    }
+public class RewriteHandlerTest extends BeanConfigTest {
 
     @Test
     public void initHandler() {
-        RewriteHandler handler = new RewriteHandler(null);
-        assert handler.add(FoundryInject.class);
+        try {
+            RewriteHandler handler = new RewriteHandler();
+            handler.insertBeans(helper().getContext());
+            assertTrue(handler.add(FoundryInject.class));
+        }catch (Exception e) {
+            e.printStackTrace();
+
+        }
     }
 
     @Test
     public void testRewriteTaskAdd() {
-        RewriteHandler handler = new RewriteHandler(null);
-        assert handler.add(FoundryInject.class);
-        assert handler.add(DocMatchRewrite.class);
-        assert handler.add(CollectionCleanupFilter.class);
-        assert handler.add(IdWriter.class);
+        RewriteHandler handler = new RewriteHandler();
+        handler.insertBeans(helper().getContext());
+        assertTrue(handler.add(FoundryInject.class));
+        assertTrue(handler.add(DocMatchRewrite.class));
+        assertTrue(handler.add(CollectionCleanupFilter.class));
+        assertTrue(handler.add(IdWriter.class));
+    }
+
+    // throws exception cause of missing configuration
+    @Test(expected = RuntimeException.class)
+    public void testRewriteConfigThrowsException() {
+        RewriteHandler handler = new RewriteHandler();
+        QuerySerializer s = new QuerySerializer();
+        s.setQuery("[(base=laufen | base=gehen) & tt/pos=VVFIN]", "poliqarp");
+        assertTrue(handler.add(FoundryInject.class));
+        handler.preProcess(s.toJSON(), null);
     }
 
     @Test
-    public void testRewriteFoundryInjectLemma() {
-        KustvaktConfiguration c = BeanConfiguration.getBeans()
-                .getConfiguration();
-        RewriteHandler handler = new RewriteHandler(c);
-        handler.add(FoundryInject.class);
+    public void testRewriteNoBeanInject() {
+        RewriteHandler handler = new RewriteHandler(helper().getContext().getConfiguration());
         QuerySerializer s = new QuerySerializer();
-        s.setQuery("[base=Haus]", "poliqarp");
-        String result = handler.preProcess(s.toJSON(), TestHelper.getUser());
-        JsonNode node = JsonUtils.readTree(result);
-        assert node != null;
-        assert node.at("/query/wrap/layer").asText().equals("lemma");
-        assert node.at("/query/wrap/foundry").asText().equals("test_l");
+        s.setQuery("[(base=laufen | base=gehen) & tt/pos=VVFIN]", "poliqarp");
+        assertTrue(handler.add(FoundryInject.class));
+        String res = handler.preProcess(s.toJSON(), null);
+        assertNotNull(res);
     }
 
     @Test
-    public void testRewriteFoundryInjectPOS() {
-        KustvaktConfiguration c = BeanConfiguration.getBeans()
-                .getConfiguration();
-        RewriteHandler handler = new RewriteHandler(c);
-        handler.add(FoundryInject.class);
+    public void testRewriteBeanInject() {
+        RewriteHandler handler = new RewriteHandler();
+        handler.insertBeans(helper().getContext());
         QuerySerializer s = new QuerySerializer();
-        s.setQuery("[pos=ADJA]", "poliqarp");
-        String result = handler.preProcess(s.toJSON(), TestHelper.getUser());
-        JsonNode node = JsonUtils.readTree(result);
-        assert node != null;
-        assert node.at("/query/wrap/layer").asText().equals("pos");
-        assert node.at("/query/wrap/foundry").asText().equals("test_p");
+        s.setQuery("[(base=laufen | base=gehen) & tt/pos=VVFIN]", "poliqarp");
+        assertTrue(handler.add(FoundryInject.class));
+        String res = handler.preProcess(s.toJSON(), null);
+        JsonNode node = JsonUtils.readTree(res);
+        assertNotNull(node);
+
+        assertEquals("tt", node.at("/query/wrap/operands/0/operands/0/foundry").asText());
+        assertEquals("tt", node.at("/query/wrap/operands/0/operands/1/foundry").asText());
+        assertEquals("tt", node.at("/query/wrap/operands/1/foundry").asText());
     }
 
+    @Test
+    public void testRewriteUserSpecific() {
+        RewriteHandler handler = new RewriteHandler();
+        handler.insertBeans(helper().getContext());
+        QuerySerializer s = new QuerySerializer();
+        s.setQuery("[(base=laufen | base=gehen) & tt/pos=VVFIN]", "poliqarp");
+        assertTrue(handler.add(FoundryInject.class));
+        String res = handler.preProcess(s.toJSON(), helper().getUser());
+        JsonNode node = JsonUtils.readTree(res);
+        assertNotNull(node);
+        assertEquals("tt_test", node.at("/query/wrap/operands/0/operands/0/foundry").asText());
+        assertEquals("tt_test", node.at("/query/wrap/operands/0/operands/1/foundry").asText());
+        assertNotEquals("tt_test", node.at("/query/wrap/operands/1/foundry").asText());
+    }
+
+    @Override
+    public void initMethod() throws KustvaktException {
+        helper().setupAccount();
+        UserDataDbIface settingsdao = BeansFactory.getTypeFactory()
+                .getTypedBean(helper().getContext().getUserDataDaos(),UserSettings.class);
+        UserSettings s = (UserSettings) settingsdao.get(helper().getUser());
+        s.setField(Attributes.DEFAULT_LEMMA_FOUNDRY, "tt_test");
+        settingsdao.update(s);
+    }
+
+
+
 }
diff --git a/src/test/java/de/ids_mannheim/korap/security/PolicyDaoTest.java b/src/test/java/de/ids_mannheim/korap/security/PolicyDaoTest.java
new file mode 100644
index 0000000..cc3afda
--- /dev/null
+++ b/src/test/java/de/ids_mannheim/korap/security/PolicyDaoTest.java
@@ -0,0 +1,232 @@
+package de.ids_mannheim.korap.security;
+
+import de.ids_mannheim.korap.config.BeanConfigTest;
+import de.ids_mannheim.korap.exceptions.KustvaktException;
+import de.ids_mannheim.korap.interfaces.db.PolicyHandlerIface;
+import de.ids_mannheim.korap.resources.Corpus;
+import de.ids_mannheim.korap.resources.KustvaktResource;
+import de.ids_mannheim.korap.resources.Permissions;
+import de.ids_mannheim.korap.resources.VirtualCollection;
+import de.ids_mannheim.korap.security.ac.PolicyBuilder;
+import de.ids_mannheim.korap.user.Attributes;
+import de.ids_mannheim.korap.user.User;
+import edu.emory.mathcs.backport.java.util.Arrays;
+import org.junit.Ignore;
+import org.junit.Test;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import static org.junit.Assert.*;
+
+/**
+ * @author hanl
+ * @date 09/02/2016
+ */
+public class PolicyDaoTest extends BeanConfigTest {
+
+
+    @Override
+    public void initMethod() throws KustvaktException {
+        helper().setupAccount();
+        helper().runBootInterfaces();
+        helper().setupResource(new Corpus("WPD_1"));
+    }
+
+    @Test
+    public void testPoliciesGet() throws KustvaktException {
+        User user = helper().getUser();
+        SecurityPolicy policy = new SecurityPolicy();
+        policy.addNewCondition(new PolicyCondition("test_1"));
+        policy.setCreator(user.getId());
+        policy.setTarget(new Corpus("WPD_1"));
+        policy.addPermission(Permissions.Permission.READ);
+
+        PolicyHandlerIface dao = helper().getContext().getPolicyDbProvider();
+        assertTrue(dao.createPolicy(policy, user) > 0);
+        dao.getPolicies("WPD_1", user, Permissions.Permission.READ.toByte());
+    }
+
+    @Test
+    public void testPolicyCreate() throws KustvaktException {
+        User user = helper().getUser();
+        SecurityPolicy policy = new SecurityPolicy();
+        policy.addNewCondition(new PolicyCondition("test_1"));
+        policy.setCreator(user.getId());
+        policy.setTarget(new Corpus("WPD_1"));
+        policy.addPermission(Permissions.Permission.READ);
+
+        PolicyHandlerIface dao = helper().getContext().getPolicyDbProvider();
+
+        assertTrue(dao.createPolicy(policy, user) > 0);
+        assertTrue(dao.deleteResourcePolicies("WPD_1", user) > 0);
+    }
+
+    @Test
+    public void testMappingConditions() {
+
+    }
+
+    @Test
+    public void failAddToConditionEqual() throws KustvaktException {
+        User user = helper().getUser();
+        SecurityPolicy policy = new SecurityPolicy();
+        policy.addNewCondition(new PolicyCondition("test_1"));
+        policy.setCreator(user.getId());
+        policy.setTarget(new Corpus("WPD_1"));
+        policy.addPermission(Permissions.Permission.READ);
+
+        PolicyHandlerIface dao = helper().getContext().getPolicyDbProvider();
+
+        assertTrue(dao.createPolicy(policy, user) > 0);
+
+        dao.addToCondition(user.getUsername(), new PolicyCondition("test_1"),
+                true);
+        assertTrue(dao.deleteResourcePolicies("WPD_1", user) > 0);
+
+    }
+
+    @Test
+    public void failAddToConditionUnEqual() throws KustvaktException {
+        User user = helper().getUser();
+        SecurityPolicy policy = new SecurityPolicy();
+        policy.addNewCondition(new PolicyCondition("test_1"));
+        policy.setCreator(user.getId());
+        policy.setTarget(new Corpus("WPD_1"));
+        policy.addPermission(Permissions.Permission.READ);
+
+        PolicyHandlerIface dao = helper().getContext().getPolicyDbProvider();
+        assertTrue(dao.createPolicy(policy, user) > 0);
+
+        dao.addToCondition(user.getUsername(), new PolicyCondition("test_1"),
+                false);
+
+        assertTrue(dao.deleteResourcePolicies("WPD_1", user) > 0);
+
+    }
+
+    @Test
+    public void removeUserFromCondition() throws KustvaktException {
+        User user = helper().getUser();
+        PolicyHandlerIface dao = helper().getContext().getPolicyDbProvider();
+
+        SecurityPolicy policy = new SecurityPolicy();
+        policy.addNewCondition(new PolicyCondition("test_1"));
+        policy.setCreator(user.getId());
+        policy.setTarget(new Corpus("WPD_1"));
+        policy.addPermission(Permissions.Permission.READ);
+
+        assertTrue(dao.createPolicy(policy, user) > 0);
+        dao.removeFromCondition(
+                Arrays.asList(new String[] { user.getUsername() }),
+                new PolicyCondition("test_1"));
+        assertTrue(dao.deleteResourcePolicies("WPD_1", user) > 0);
+    }
+
+    @Test
+    public void testPolicyHierarchySelfSameType() throws KustvaktException {
+        String res = "WPD_child";
+        User user = helper().getUser();
+        Corpus c = new Corpus(res);
+        c.setParentID("WPD_1");
+        helper().setupResource(c);
+        PolicyHandlerIface dao = helper().getContext().getPolicyDbProvider();
+
+        List[] pol = dao.getPolicies("WPD_child", user,
+                Permissions.Permission.READ.toByte());
+        assertNotNull(pol);
+        assertNotNull(pol[0]);
+        assertTrue(pol[0].get(0) instanceof SecurityPolicy.OwnerPolicy);
+        assertTrue(pol[1].get(0) instanceof SecurityPolicy.OwnerPolicy);
+
+        helper().dropResource(res);
+    }
+
+    @Test
+    @Ignore
+    public void testPolicyHierarchySelfDifferentType()
+            throws KustvaktException {
+        String res = "WPD_child";
+        User user = helper().getUser();
+        VirtualCollection c = new VirtualCollection(res);
+        c.setParentID(helper().getResource("WPD_1").getPersistentID());
+        helper().setupResource(c);
+
+        PolicyHandlerIface dao = helper().getContext().getPolicyDbProvider();
+
+        List[] pol = dao.getPolicies("WPD_child", user,
+                Permissions.Permission.READ.toByte());
+        assertNotNull(pol);
+        assertNotNull(pol[0]);
+        assertTrue(pol[0].get(0) instanceof SecurityPolicy.OwnerPolicy);
+        assertTrue(pol[1].get(0) instanceof SecurityPolicy.OwnerPolicy);
+        helper().dropResource(res);
+    }
+
+    @Test
+    public void testPolicyHierarchyPublic() {
+
+    }
+
+    @Test
+    public void testPoliciesPublic() {
+        PolicyHandlerIface dao = helper().getContext().getPolicyDbProvider();
+        Collection<SecurityPolicy> policies = dao
+                .getPolicies(new PolicyCondition("public"), Corpus.class,
+                        Permissions.Permission.READ.toByte());
+        assertNotEquals(0, policies.size());
+    }
+
+    @Test
+    @Ignore
+    public void testPoliciesPublicGeneric() {
+        PolicyHandlerIface dao = helper().getContext().getPolicyDbProvider();
+        Collection<SecurityPolicy> policies = dao
+                .getPolicies(new PolicyCondition("public"),
+                        KustvaktResource.class,
+                        Permissions.Permission.READ.toByte());
+        assertNotEquals(0, policies.size());
+    }
+
+    @Test
+    public void searchResourcePoliciesPublic() throws KustvaktException {
+        User user = helper().getUser();
+        new PolicyBuilder(user).setConditions(new PolicyCondition("public"))
+                .setPermissions(Permissions.Permission.READ)
+                .setResources(new VirtualCollection("new_corpus")).create();
+
+        PolicyHandlerIface dao = helper().getContext().getPolicyDbProvider();
+        List<SecurityPolicy> list = dao
+                .getPolicies(new PolicyCondition(Attributes.PUBLIC_GROUP),
+                        VirtualCollection.class,
+                        Permissions.Permission.READ.toByte());
+        assertNotEquals(0, list.size());
+        Set<String> ids = new HashSet<>();
+        for (SecurityPolicy p : list)
+            ids.add(p.getTarget());
+        assertNotEquals(0, ids.size());
+    }
+
+    @Test
+    public void testPolicyHierarchyRestricted() {
+
+    }
+
+    @Test
+    public void testSelfPolicies() {
+
+    }
+
+    @Test
+    public void testPublicPolicies() {
+
+    }
+
+    @Test
+    public void testConditions() {
+
+    }
+
+}
diff --git a/src/test/java/de/ids_mannheim/korap/security/auth/KustvaktAuthenticationManagerTest.java b/src/test/java/de/ids_mannheim/korap/security/auth/KustvaktAuthenticationManagerTest.java
index 0c2adc1..681c197 100644
--- a/src/test/java/de/ids_mannheim/korap/security/auth/KustvaktAuthenticationManagerTest.java
+++ b/src/test/java/de/ids_mannheim/korap/security/auth/KustvaktAuthenticationManagerTest.java
@@ -1,107 +1,111 @@
 package de.ids_mannheim.korap.security.auth;
 
-import de.ids_mannheim.korap.config.BeanConfiguration;
+import de.ids_mannheim.korap.config.BeanConfigTest;
 import de.ids_mannheim.korap.config.KustvaktBaseDaoInterface;
 import de.ids_mannheim.korap.config.KustvaktConfiguration;
-import de.ids_mannheim.korap.config.TestHelper;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.interfaces.AuthenticationManagerIface;
 import de.ids_mannheim.korap.interfaces.db.EntityHandlerIface;
 import de.ids_mannheim.korap.user.*;
 import org.junit.After;
 import org.junit.AfterClass;
-import org.junit.BeforeClass;
+import org.junit.Assert;
 import org.junit.Test;
 
+import static org.junit.Assert.assertNotEquals;
+import static org.junit.Assert.assertNotNull;
+
 /**
  * @author hanl
  * @date 04/02/2016
  */
-public class KustvaktAuthenticationManagerTest {
-
-    @BeforeClass
-    public static void create() {
-        BeanConfiguration.loadClasspathContext("default-config.xml");
-        assert TestHelper.setupAccount();
-    }
-
-    @AfterClass
-    public static void close() {
-        assert TestHelper.dropUser();
-        BeanConfiguration.closeApplication();
-    }
+public class KustvaktAuthenticationManagerTest extends BeanConfigTest {
 
     @After
-    public void after() throws KustvaktException {
-        User user = BeanConfiguration.getBeans().getAuthenticationManager()
-                .getUser((String) KustvaktConfiguration.KUSTVAKT_USER
-                        .get(Attributes.USERNAME));
-        BeanConfiguration.getBeans().getAuthenticationManager()
-                .deleteAccount(user);
+    public void after() {
+        try {
+            User user = helper().getContext().getAuthenticationManager().getUser(
+                    (String) KustvaktConfiguration.KUSTVAKT_USER
+                            .get(Attributes.USERNAME));
+            helper().getContext().getAuthenticationManager().deleteAccount(user);
+        } catch (KustvaktException e) {
+        }
     }
 
     @Test
     public void testCreateUser() throws KustvaktException {
-        User user = BeanConfiguration.getBeans().getAuthenticationManager()
+        User user = helper().getContext().getAuthenticationManager()
                 .createUserAccount(KustvaktConfiguration.KUSTVAKT_USER, false);
 
-        EntityHandlerIface dao = BeanConfiguration.getBeans()
-                .getUserDBHandler();
-
-        assert ((KustvaktBaseDaoInterface) dao).size() > 0;
+        EntityHandlerIface dao = helper().getContext().getUserDBHandler();
+        assertNotEquals(0, ((KustvaktBaseDaoInterface) dao).size());
         User check = dao.getAccount(user.getUsername());
-        assert check != null;
+        assertNotNull(check);
+    }
+
+    @Test
+    public void testBatchStore() {
+        int i = 6;
+
+        AuthenticationManagerIface manager = helper().getContext()
+                .getAuthenticationManager();
+        for (int ix = 0; ix < i; ix++) {
+        }
+
     }
 
     @Test
     public void testUserdetailsGet() throws KustvaktException {
         testCreateUser();
-        AuthenticationManagerIface manager = BeanConfiguration.getBeans()
+        AuthenticationManagerIface manager = helper().getContext()
                 .getAuthenticationManager();
 
         User user = manager.getUser((String) KustvaktConfiguration.KUSTVAKT_USER
                 .get(Attributes.USERNAME));
 
         Userdata data = manager.getUserData(user, UserDetails.class);
-
-        assert data != null;
+        assertNotNull(data);
     }
 
     @Test
     public void testUsersettingsGet() throws KustvaktException {
         testCreateUser();
-        AuthenticationManagerIface manager = BeanConfiguration.getBeans()
+        AuthenticationManagerIface manager = helper().getContext()
                 .getAuthenticationManager();
 
         User user = manager.getUser((String) KustvaktConfiguration.KUSTVAKT_USER
                 .get(Attributes.USERNAME));
 
         Userdata data = manager.getUserData(user, UserSettings.class);
-        assert data != null;
+        assertNotNull(data);
     }
 
     @Test(expected = KustvaktException.class)
     public void testUserDetailsGetNonExistent() throws KustvaktException {
         testCreateUser();
-        AuthenticationManagerIface manager = BeanConfiguration.getBeans()
+        AuthenticationManagerIface manager = helper().getContext()
                 .getAuthenticationManager();
 
         User user = new KorAPUser(10, "random");
 
         Userdata data = manager.getUserData(user, UserDetails.class);
-        assert data != null;
+        assertNotNull(data);
     }
 
     @Test(expected = KustvaktException.class)
     public void testUserSettingsGetNonExistent() throws KustvaktException {
         testCreateUser();
-        AuthenticationManagerIface manager = BeanConfiguration.getBeans()
+        AuthenticationManagerIface manager = helper().getContext()
                 .getAuthenticationManager();
 
         User user = new KorAPUser(10, "random");
 
         Userdata data = manager.getUserData(user, UserSettings.class);
-        assert data != null;
+        assertNotNull(data);
     }
 
+    @Override
+    public void initMethod() throws KustvaktException {
+        helper().setupAccount();
+    }
 }
diff --git a/src/test/java/de/ids_mannheim/korap/suites/DaoTestSuite.java b/src/test/java/de/ids_mannheim/korap/suites/DaoTestSuite.java
new file mode 100644
index 0000000..d569aa9
--- /dev/null
+++ b/src/test/java/de/ids_mannheim/korap/suites/DaoTestSuite.java
@@ -0,0 +1,20 @@
+package de.ids_mannheim.korap.suites;
+
+import de.ids_mannheim.korap.handlers.ResourceDaoTest;
+import de.ids_mannheim.korap.handlers.UserDaoTest;
+import de.ids_mannheim.korap.security.PolicyDaoTest;
+import de.ids_mannheim.korap.user.UserdataTest;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+/**
+ * @author hanl
+ * @date 26/02/2016
+ */
+
+@Deprecated
+@RunWith(Suite.class)
+@Suite.SuiteClasses({ PolicyDaoTest.class, UserdataTest.class,
+        UserDaoTest.class, ResourceDaoTest.class })
+public class DaoTestSuite {
+}
diff --git a/src/test/java/de/ids_mannheim/korap/user/UserdataTest.java b/src/test/java/de/ids_mannheim/korap/user/UserdataTest.java
index e6da9e5..de082af 100644
--- a/src/test/java/de/ids_mannheim/korap/user/UserdataTest.java
+++ b/src/test/java/de/ids_mannheim/korap/user/UserdataTest.java
@@ -1,115 +1,120 @@
 package de.ids_mannheim.korap.user;
 
-import de.ids_mannheim.korap.config.BeanConfiguration;
+import de.ids_mannheim.korap.config.BeanConfigTest;
+import de.ids_mannheim.korap.config.BeansFactory;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.exceptions.dbException;
 import de.ids_mannheim.korap.handlers.UserDetailsDao;
 import de.ids_mannheim.korap.handlers.UserSettingsDao;
 import de.ids_mannheim.korap.interfaces.db.UserDataDbIface;
-import org.junit.AfterClass;
 import org.junit.Before;
-import org.junit.BeforeClass;
 import org.junit.Test;
 
+import static org.junit.Assert.*;
+
 /**
  * @author hanl
  * @date 27/01/2016
  */
-public class UserdataTest {
-
-    @BeforeClass
-    public static void init() {
-        BeanConfiguration.loadClasspathContext("default-config.xml");
-    }
-
-    @AfterClass
-    public static void drop() {
-        BeanConfiguration.closeApplication();
-    }
+public class UserdataTest extends BeanConfigTest {
 
     @Before
     public void clear() {
         UserDetailsDao dao = new UserDetailsDao(
-                BeanConfiguration.getBeans().getPersistenceClient());
+                helper().getContext().getPersistenceClient());
         UserSettingsDao sdao = new UserSettingsDao(
-                BeanConfiguration.getBeans().getPersistenceClient());
-        assert dao.deleteAll() != -1;
-        assert sdao.deleteAll() != -1;
+                helper().getContext().getPersistenceClient());
+        assertNotEquals(-1, dao.deleteAll());
+        assertNotEquals(-1, sdao.deleteAll());
     }
 
     @Test
     public void testDataStore() {
+        String val = "value1;value_data";
         User user = new KorAPUser();
         user.setId(1);
         UserDetailsDao dao = new UserDetailsDao(
-                BeanConfiguration.getBeans().getPersistenceClient());
+                helper().getContext().getPersistenceClient());
         UserDetails d = new UserDetails(1);
-        d.addField("key_1", "value is a value");
-        assert dao.store(d) != -1;
+        d.setField("key_1", val);
+        assertNotEquals(-1, dao.store(d));
     }
 
     @Test
     public void testDataGet() throws dbException {
+        String val = "value1;value_data";
         User user = new KorAPUser();
         user.setId(1);
         UserDetailsDao dao = new UserDetailsDao(
-                BeanConfiguration.getBeans().getPersistenceClient());
+                helper().getContext().getPersistenceClient());
         UserDetails d = new UserDetails(1);
-        d.addField("key_1", "value is a value");
-        assert dao.store(d) != -1;
+        d.setField("key_1", val);
+        assertNotEquals(-1, dao.store(d));
 
         d = dao.get(d.getId());
-        assert d != null;
-        assert "value is a value".equals(d.get("key_1"));
+        assertNotNull(d);
+        assertEquals(val, d.get("key_1"));
 
         d = dao.get(user);
-        assert d != null;
-        assert "value is a value".equals(d.get("key_1"));
+        assertNotNull(d);
+        assertEquals(val, d.get("key_1"));
     }
 
     @Test
     public void testDataValidation() {
         Userdata data = new UserDetails(1);
-        data.addField(Attributes.COUNTRY, "Germany");
+        data.setField(Attributes.COUNTRY, "Germany");
 
         String[] req = data.requiredFields();
         String[] r = data.missing();
-        assert r.length > 0;
-        assert r.length == req.length;
-        assert !data.isValid();
+        assertNotEquals(0, r.length);
+        assertEquals(req.length, r.length);
+        assertFalse(data.isValid());
     }
 
     @Test
     public void testSettingsValidation() {
         Userdata data = new UserSettings(1);
-        data.addField(Attributes.FILE_FORMAT_FOR_EXPORT, "export");
+        data.setField(Attributes.FILE_FORMAT_FOR_EXPORT, "export");
 
         String[] req = data.requiredFields();
         String[] r = data.missing();
-        assert r.length == 0;
-        assert r.length == req.length;
-        assert data.isValid();
+        assertEquals(0, r.length);
+        assertEquals(req.length, r.length);
+        assertTrue(data.isValid());
     }
 
     @Test
     public void testUserdatafactory() throws KustvaktException {
-        UserDataDbIface dao = UserdataFactory.getDaoInstance(UserDetails.class);
-        assert UserDetailsDao.class.equals(dao.getClass());
+        UserDataDbIface dao = BeansFactory.getTypeFactory()
+                .getTypedBean(helper().getContext().getUserDataDaos(), UserDetails.class);
+        assertNotNull(dao);
+        assertEquals(UserDetailsDao.class, dao.getClass());
+
+        dao = BeansFactory.getTypeFactory()
+                .getTypedBean(helper().getContext().getUserDataDaos(), UserSettings.class);
+        assertNotNull(dao);
+        assertEquals(UserSettingsDao.class, dao.getClass());
+
     }
 
-    @Test(expected = KustvaktException.class)
+    @Test(expected = RuntimeException.class)
     public void testUserdatafactoryError() throws KustvaktException {
-        UserdataFactory.getDaoInstance(new Userdata(1) {
-            @Override
-            public String[] requiredFields() {
-                return new String[0];
-            }
+        BeansFactory.getTypeFactory()
+                .getTypedBean(helper().getContext().getUserDataDaos(), new Userdata(1) {
+                    @Override
+                    public String[] requiredFields() {
+                        return new String[0];
+                    }
 
-            @Override
-            public String[] defaultFields() {
-                return new String[0];
-            }
-        }.getClass());
+                    @Override
+                    public String[] defaultFields() {
+                        return new String[0];
+                    }
+                }.getClass());
     }
 
+    @Override
+    public void initMethod() throws KustvaktException {
+    }
 }
diff --git a/src/test/java/de/ids_mannheim/korap/web/service/FastJerseyTest.java b/src/test/java/de/ids_mannheim/korap/web/service/FastJerseyTest.java
index c49b605..83e1438 100644
--- a/src/test/java/de/ids_mannheim/korap/web/service/FastJerseyTest.java
+++ b/src/test/java/de/ids_mannheim/korap/web/service/FastJerseyTest.java
@@ -11,6 +11,7 @@
 import com.sun.jersey.test.framework.spi.container.TestContainerFactory;
 import com.sun.jersey.test.framework.spi.container.grizzly.GrizzlyTestContainerFactory;
 import com.sun.jersey.test.framework.spi.container.grizzly.web.GrizzlyWebTestContainerFactory;
+import de.ids_mannheim.korap.config.BeanConfigTest;
 import org.junit.AfterClass;
 import org.junit.Before;
 import org.junit.BeforeClass;
@@ -23,7 +24,7 @@
  * @author hanl
  * @date 29/07/2015
  */
-public abstract class FastJerseyTest {
+public abstract class FastJerseyTest extends BeanConfigTest {
 
     private final static String API_VERSION = "v0.1";
 
diff --git a/src/test/java/de/ids_mannheim/korap/web/service/OAuth2HandlerTest.java b/src/test/java/de/ids_mannheim/korap/web/service/OAuth2HandlerTest.java
index 4cf5ecb..ce7851d 100644
--- a/src/test/java/de/ids_mannheim/korap/web/service/OAuth2HandlerTest.java
+++ b/src/test/java/de/ids_mannheim/korap/web/service/OAuth2HandlerTest.java
@@ -1,15 +1,14 @@
 package de.ids_mannheim.korap.web.service;
 
 import de.ids_mannheim.korap.config.AuthCodeInfo;
-import de.ids_mannheim.korap.config.BeanConfiguration;
+import de.ids_mannheim.korap.config.BeanConfigTest;
 import de.ids_mannheim.korap.config.ClientInfo;
-import de.ids_mannheim.korap.config.TestHelper;
+import de.ids_mannheim.korap.config.ContextHolder;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.handlers.OAuth2Handler;
 import de.ids_mannheim.korap.interfaces.EncryptionIface;
+import de.ids_mannheim.korap.interfaces.db.PersistenceClient;
 import de.ids_mannheim.korap.user.TokenContext;
-import de.ids_mannheim.korap.user.User;
-import org.junit.AfterClass;
 import org.junit.Assert;
 import org.junit.BeforeClass;
 import org.junit.Test;
@@ -19,48 +18,50 @@
  * @date 13/05/2015
  */
 
-public class OAuth2HandlerTest {
+public class OAuth2HandlerTest extends BeanConfigTest {
 
     private static ClientInfo info;
-    private static OAuth2Handler handler;
-    private static EncryptionIface crypto;
+
     private static final String SCOPES = "search preferences queries account";
-    private static User user;
 
     @BeforeClass
-    public static void setup() throws KustvaktException {
-        BeanConfiguration.loadClasspathContext("default-config.xml");
-        handler = new OAuth2Handler(
-                BeanConfiguration.getBeans().getPersistenceClient());
-        crypto = BeanConfiguration.getBeans().getEncryption();
-        info = new ClientInfo(crypto.createID(), crypto.createToken());
-        info.setConfidential(true);
-        //todo: support for subdomains?!
-        info.setUrl("http://localhost:8080/api/v0.1");
-        info.setRedirect_uri("testwebsite/login");
-
-        TestHelper.setupAccount();
-        user = TestHelper.getUser();
-        handler.registerClient(info, user);
+    public static void setup() throws Exception {
+        //        BeanConfiguration.loadClasspathContext("default-config.xml");
+        //        handler = new OAuth2Handler(
+        //                BeanConfiguration.getKustvaktContext().getPersistenceClient());
+        //        crypto = BeanConfiguration.getKustvaktContext().getEncryption();
+//        info = new ClientInfo(crypto.createID(), crypto.createToken());
+        //        info.setConfidential(true);
+        //        //todo: support for subdomains?!
+        //        info.setUrl("http://localhost:8080/api/v0.1");
+        //        info.setRedirect_uri("testwebsite/login");
+        //
+        //        helper = TestHelper.newInstance();
+        //        helper.setupAccount();
+        //        PersistenceClient cl = helper.getBean(ContextHolder.KUSTVAKT_DB);
+        //        handler = new OAuth2Handler(cl);
+        //        handler.registerClient(info, helper.getUser());
+        //        crypto = helper.getBean(ContextHolder.KUSTVAKT_ENCRYPTION);
     }
 
-    @AfterClass
-    public static void drop() throws KustvaktException {
-        assert handler != null;
-        handler.removeClient(info, user);
-        TestHelper.dropUser();
-        BeanConfiguration.closeApplication();
-    }
+    //    @AfterClass
+    //    public static void drop() throws KustvaktException {
+    //        assert handler != null;
+    //        handler.removeClient(info, helper().getUser());
+    //        helper().dropUser();
+    //        BeansFactory.closeApplication();
+    //    }
 
     @Test
     public void testStoreAuthorizationCodeThrowsNoException()
             throws KustvaktException {
-        String auth_code = crypto.createToken();
+        String auth_code = helper().getContext().getEncryption().createToken();
         AuthCodeInfo codeInfo = new AuthCodeInfo(info.getClient_id(),
                 auth_code);
         codeInfo.setScopes(SCOPES);
 
-        handler.authorize(codeInfo, user);
+        OAuth2Handler handler = new OAuth2Handler(helper().getContext().getPersistenceClient());
+        handler.authorize(codeInfo, helper().getUser());
         codeInfo = handler.getAuthorization(auth_code);
         Assert.assertNotNull("client is null!", codeInfo);
     }
@@ -68,14 +69,15 @@
     @Test
     public void testAuthorizationCodeRemoveThrowsNoException()
             throws KustvaktException {
-        String auth_code = crypto.createToken();
+        String auth_code = helper().getContext().getEncryption().createToken();
         AuthCodeInfo codeInfo = new AuthCodeInfo(info.getClient_id(),
                 auth_code);
         codeInfo.setScopes(SCOPES);
 
-        handler.authorize(codeInfo, user);
-        String t = crypto.createToken();
-        String refresh = crypto.createToken();
+        OAuth2Handler handler = new OAuth2Handler(helper().getContext().getPersistenceClient());
+        handler.authorize(codeInfo, helper().getUser());
+        String t = helper().getContext().getEncryption().createToken();
+        String refresh = helper().getContext().getEncryption().createToken();
         handler.addToken(codeInfo.getCode(), t, refresh, 7200);
 
         TokenContext ctx = handler.getContext(t);
@@ -92,7 +94,7 @@
 
     @Test
     public void testStoreAccessCodeViaAuthCodeThrowsNoException() {
-        String auth_code = crypto.createToken();
+        String auth_code = helper().getContext().getEncryption().createToken();
         AuthCodeInfo codeInfo = new AuthCodeInfo(info.getClient_id(),
                 auth_code);
         codeInfo.setScopes(SCOPES);
@@ -119,4 +121,19 @@
     public void testAccessTokenExpired() {
 
     }
+
+    @Override
+    public void initMethod() throws KustvaktException {
+        helper().setupAccount();
+
+        EncryptionIface crypto = helper().getContext().getEncryption();
+        info = new ClientInfo(crypto.createID(), crypto.createToken());
+        info.setConfidential(true);
+        //todo: support for subdomains?!
+        info.setUrl("http://localhost:8080/api/v0.1");
+        info.setRedirect_uri("testwebsite/login");
+        PersistenceClient cl = helper().getBean(ContextHolder.KUSTVAKT_DB);
+        OAuth2Handler handler = new OAuth2Handler(cl);
+        handler.registerClient(info, helper().getUser());
+    }
 }
diff --git a/src/test/java/de/ids_mannheim/korap/web/service/full/AuthServiceTest.java b/src/test/java/de/ids_mannheim/korap/web/service/full/AuthServiceTest.java
index 6ba0ddc..9a3f782 100644
--- a/src/test/java/de/ids_mannheim/korap/web/service/full/AuthServiceTest.java
+++ b/src/test/java/de/ids_mannheim/korap/web/service/full/AuthServiceTest.java
@@ -1,6 +1,11 @@
 package de.ids_mannheim.korap.web.service.full;
 
+import de.ids_mannheim.korap.config.TestHelper;
+import de.ids_mannheim.korap.exceptions.KustvaktException;
+import de.ids_mannheim.korap.user.User;
 import de.ids_mannheim.korap.web.service.FastJerseyTest;
+import org.junit.BeforeClass;
+import org.junit.Test;
 
 /**
  * @author hanl
@@ -8,6 +13,40 @@
  */
 public class AuthServiceTest extends FastJerseyTest {
 
+    @BeforeClass
+    public static void configure() throws Exception {
+        FastJerseyTest.setPackages("de.ids_mannheim.korap.web.service",
+                "de.ids_mannheim.korap.web.filter",
+                "de.ids_mannheim.korap.web.utils");
+    }
+
+
+    @Override
+    public void initMethod() throws KustvaktException {
+        helper().setupAccount();
+    }
+
+    @Test
+    public void testBasicHttp() {
+        User user = helper().getUser();
+
+    }
+
+    @Test
+    public void testBasicLogout(){
+
+    }
+
+    @Test
+    public void testSessionTokenLogin() {
+
+    }
+
+    @Test
+    public void testSessionTokenLogout() {
+
+    }
+
     //todo: test basicauth via secure connection
 
 }
diff --git a/src/test/java/de/ids_mannheim/korap/web/service/full/FilterTest.java b/src/test/java/de/ids_mannheim/korap/web/service/full/FilterTest.java
index 4b6f118..ac05e24 100644
--- a/src/test/java/de/ids_mannheim/korap/web/service/full/FilterTest.java
+++ b/src/test/java/de/ids_mannheim/korap/web/service/full/FilterTest.java
@@ -1,13 +1,12 @@
 package de.ids_mannheim.korap.web.service.full;
 
 import com.sun.jersey.api.client.ClientResponse;
-import de.ids_mannheim.korap.config.BeanConfiguration;
 import de.ids_mannheim.korap.config.TestHelper;
+import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.security.auth.BasicHttpAuth;
 import de.ids_mannheim.korap.user.Attributes;
 import de.ids_mannheim.korap.web.service.FastJerseyTest;
 import org.eclipse.jetty.server.Response;
-import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Test;
 
@@ -18,18 +17,10 @@
 public class FilterTest extends FastJerseyTest {
 
     @BeforeClass
-    public static void setup() {
-        BeanConfiguration.loadClasspathContext("default-config.xml");
+    public static void setup() throws Exception {
         FastJerseyTest.setPackages("de.ids_mannheim.korap.web.service.full",
                 "de.ids_mannheim.korap.web.filter",
                 "de.ids_mannheim.korap.web.utils");
-        TestHelper.setupAccount();
-    }
-
-    @AfterClass
-    public static void close() {
-        TestHelper.dropUser();
-        BeanConfiguration.closeApplication();
     }
 
     @Test
@@ -40,7 +31,6 @@
                                 TestHelper.getUserCredentials()[1]))
                 .get(ClientResponse.class);
         assert resp.getStatus() == Response.SC_OK;
-        System.out.println("entity '" + resp.getEntity(String.class) + "'");
     }
 
     @Test
@@ -58,4 +48,9 @@
                 .get(ClientResponse.class);
         assert resp.getStatus() == Response.SC_UNAUTHORIZED;
     }
+
+    @Override
+    public void initMethod() throws KustvaktException {
+        helper().setupAccount();
+    }
 }
diff --git a/src/test/java/de/ids_mannheim/korap/web/service/full/KustvaktCoreRestTest.java b/src/test/java/de/ids_mannheim/korap/web/service/full/KustvaktCoreRestTest.java
index f297953..f227ba3 100644
--- a/src/test/java/de/ids_mannheim/korap/web/service/full/KustvaktCoreRestTest.java
+++ b/src/test/java/de/ids_mannheim/korap/web/service/full/KustvaktCoreRestTest.java
@@ -1,12 +1,11 @@
 package de.ids_mannheim.korap.web.service.full;
 
 import com.sun.jersey.api.client.ClientResponse;
-import de.ids_mannheim.korap.config.BeanConfiguration;
+import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.query.serialize.CollectionQueryProcessor;
 import de.ids_mannheim.korap.query.serialize.QuerySerializer;
 import de.ids_mannheim.korap.utils.JsonUtils;
 import de.ids_mannheim.korap.web.service.FastJerseyTest;
-import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Ignore;
 import org.junit.Test;
@@ -22,17 +21,11 @@
 
     @BeforeClass
     public static void configure() {
-        BeanConfiguration.loadClasspathContext();
         FastJerseyTest.setPackages("de.ids_mannheim.korap.web.service.light",
                 "de.ids_mannheim.korap.web.filter",
                 "de.ids_mannheim.korap.web.utils");
     }
 
-    @AfterClass
-    public static void close() {
-        BeanConfiguration.closeApplication();
-    }
-
     //    @Test
     public void testFieldsInSearch() {
         ClientResponse response = resource().path(getAPIVersion())
@@ -113,4 +106,8 @@
         System.out.println("RESPONSE " + response.getEntity(String.class));
     }
 
+    @Override
+    public void initMethod() throws KustvaktException {
+        helper().setupAccount();
+    }
 }
diff --git a/src/test/java/de/ids_mannheim/korap/web/service/full/KustvaktResourceServiceTest.java b/src/test/java/de/ids_mannheim/korap/web/service/full/KustvaktResourceServiceTest.java
deleted file mode 100644
index 45182a6..0000000
--- a/src/test/java/de/ids_mannheim/korap/web/service/full/KustvaktResourceServiceTest.java
+++ /dev/null
@@ -1,103 +0,0 @@
-package de.ids_mannheim.korap.web.service.full;
-
-import com.fasterxml.jackson.databind.JsonNode;
-import com.sun.jersey.api.client.ClientResponse;
-import de.ids_mannheim.korap.config.BeanConfiguration;
-import de.ids_mannheim.korap.config.TestHelper;
-import de.ids_mannheim.korap.exceptions.KustvaktException;
-import de.ids_mannheim.korap.security.auth.BasicHttpAuth;
-import de.ids_mannheim.korap.user.Attributes;
-import de.ids_mannheim.korap.utils.JsonUtils;
-import de.ids_mannheim.korap.web.service.FastJerseyTest;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Ignore;
-import org.junit.Test;
-
-/**
- * @author hanl
- * @date 14/01/2016
- */
-public class KustvaktResourceServiceTest extends FastJerseyTest {
-
-    @BeforeClass
-    public static void configure() {
-        BeanConfiguration.loadClasspathContext("default-config.xml");
-        FastJerseyTest.setPackages("de.ids_mannheim.korap.web.service.full",
-                "de.ids_mannheim.korap.web.filter",
-                "de.ids_mannheim.korap.web.utils");
-        TestHelper.runBootInterfaces();
-    }
-
-    @AfterClass
-    public static void close() throws KustvaktException {
-        BeanConfiguration.getBeans().getResourceProvider().deleteAll();
-        BeanConfiguration.closeApplication();
-    }
-
-    @Test
-    public void testSearchSimple() {
-        ClientResponse response = resource().path(getAPIVersion())
-                .path("search").queryParam("q", "[base=Wort]")
-                .queryParam("ql", "poliqarp")
-                //                .queryParam("cq", "corpusID=GOE")
-                .header(Attributes.AUTHORIZATION,
-                        BasicHttpAuth.encode("kustvakt", "kustvakt2015"))
-                .get(ClientResponse.class);
-        assert ClientResponse.Status.OK.getStatusCode() == response.getStatus();
-
-        JsonNode node = JsonUtils.readTree(response.getEntity(String.class));
-        assert node.path("matches").size() > 0;
-    }
-
-    @Test
-    public void testCollectionGet() {
-        ClientResponse response = resource().path(getAPIVersion())
-                .path("collection").header(Attributes.AUTHORIZATION,
-                        BasicHttpAuth.encode("kustvakt", "kustvakt2015"))
-                .get(ClientResponse.class);
-        assert ClientResponse.Status.OK.getStatusCode() == response.getStatus();
-
-        JsonNode node = JsonUtils.readTree(response.getEntity(String.class));
-
-        assert node.size() > 0;
-    }
-
-    @Test
-    @Ignore
-    public void testStats() {
-        ClientResponse response = resource().path(getAPIVersion())
-                .path("collection").header(Attributes.AUTHORIZATION,
-                        BasicHttpAuth.encode("kustvakt", "kustvakt2015"))
-                .get(ClientResponse.class);
-        assert ClientResponse.Status.OK.getStatusCode() == response.getStatus();
-
-        JsonNode node = JsonUtils.readTree(response.getEntity(String.class));
-        assert node != null;
-
-        System.out.println("-------------------------------");
-        System.out.println("NODE COLLECTIONS" + node);
-        String id = node.path(0).path("id").asText();
-
-        System.out.println("ID IS " + id);
-        System.out.println("FROM NODE " + node);
-        response = resource().path(getAPIVersion()).path("collection").path(id)
-                .path("stats").header(Attributes.AUTHORIZATION,
-                        BasicHttpAuth.encode("kustvakt", "kustvakt2015"))
-                .get(ClientResponse.class);
-
-        assert ClientResponse.Status.OK.getStatusCode() == response.getStatus();
-        node = JsonUtils.readTree(response.getEntity(String.class));
-        assert node != null;
-        int docs = node.path("documents").asInt();
-        System.out.println("-------------------------------");
-        System.out.println("NODE " + node);
-        assert docs > 0 && docs < 15;
-    }
-
-    @Test
-    public void testResourceStore() {
-
-    }
-
-}
diff --git a/src/test/java/de/ids_mannheim/korap/web/service/full/OAuth2EndpointTest.java b/src/test/java/de/ids_mannheim/korap/web/service/full/OAuth2EndpointTest.java
index b94be84..9870cea 100644
--- a/src/test/java/de/ids_mannheim/korap/web/service/full/OAuth2EndpointTest.java
+++ b/src/test/java/de/ids_mannheim/korap/web/service/full/OAuth2EndpointTest.java
@@ -2,13 +2,12 @@
 
 import com.fasterxml.jackson.databind.JsonNode;
 import com.sun.jersey.api.client.ClientResponse;
-import de.ids_mannheim.korap.config.BeanConfiguration;
 import de.ids_mannheim.korap.config.TestHelper;
+import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.security.auth.BasicHttpAuth;
 import de.ids_mannheim.korap.user.Attributes;
 import de.ids_mannheim.korap.utils.JsonUtils;
 import de.ids_mannheim.korap.web.service.FastJerseyTest;
-import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Ignore;
 import org.junit.Test;
@@ -20,24 +19,11 @@
 // todo: in combination with other tests, causes failures!
 public class OAuth2EndpointTest extends FastJerseyTest {
 
-    private static String[] credentials;
-
-    @AfterClass
-    public static void close() {
-        System.out.println("RUNNING AFTER CLASS SHUTDOWN");
-        TestHelper.dropUser();
-        BeanConfiguration.closeApplication();
-    }
-
     @BeforeClass
-    public static void configure() {
-        BeanConfiguration.loadClasspathContext("default-config.xml");
+    public static void configure() throws Exception {
         FastJerseyTest.setPackages("de.ids_mannheim.korap.web.service",
                 "de.ids_mannheim.korap.web.filter",
                 "de.ids_mannheim.korap.web.utils");
-
-        TestHelper.setupAccount();
-        credentials = TestHelper.getUserCredentials();
     }
 
     @Test
@@ -45,6 +31,11 @@
 
     }
 
+    @Override
+    public void initMethod() throws KustvaktException {
+        helper().setupAccount();
+    }
+
     @Test
     @Ignore
     public void testAuthorizeClient() {
@@ -72,7 +63,8 @@
     @Test
     @Ignore
     public void authenticate() {
-        String enc = BasicHttpAuth.encode(credentials[0], credentials[1]);
+        String[] cred = TestHelper.getUserCredentials();
+        String enc = BasicHttpAuth.encode(cred[0], cred[1]);
         ClientResponse response = resource().path("v0.1").path("oauth2")
                 .path("register")
                 .queryParam("redirect_url", "korap.ids-mannheim.de/redirect")
diff --git a/src/test/java/de/ids_mannheim/korap/web/service/full/ResourceServiceTest.java b/src/test/java/de/ids_mannheim/korap/web/service/full/ResourceServiceTest.java
index d202175..f3cf778 100644
--- a/src/test/java/de/ids_mannheim/korap/web/service/full/ResourceServiceTest.java
+++ b/src/test/java/de/ids_mannheim/korap/web/service/full/ResourceServiceTest.java
@@ -2,18 +2,20 @@
 
 import com.fasterxml.jackson.databind.JsonNode;
 import com.sun.jersey.api.client.ClientResponse;
-import de.ids_mannheim.korap.config.BeanConfiguration;
-import de.ids_mannheim.korap.config.TestHelper;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.security.auth.BasicHttpAuth;
 import de.ids_mannheim.korap.user.Attributes;
 import de.ids_mannheim.korap.utils.JsonUtils;
 import de.ids_mannheim.korap.web.service.FastJerseyTest;
-import org.junit.AfterClass;
+import org.junit.Assert;
 import org.junit.BeforeClass;
 import org.junit.Ignore;
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotEquals;
+import static org.junit.Assert.assertNotNull;
+
 /**
  * @author hanl
  * @date 14/01/2016
@@ -21,21 +23,14 @@
 public class ResourceServiceTest extends FastJerseyTest {
 
     @BeforeClass
-    public static void configure() {
-        BeanConfiguration.loadClasspathContext("default-config.xml");
+    public static void configure() throws Exception {
         FastJerseyTest.setPackages("de.ids_mannheim.korap.web.service.full",
                 "de.ids_mannheim.korap.web.filter",
                 "de.ids_mannheim.korap.web.utils");
-        TestHelper.runBootInterfaces();
-    }
-
-    @AfterClass
-    public static void close() throws KustvaktException {
-        BeanConfiguration.getBeans().getResourceProvider().deleteAll();
-        BeanConfiguration.closeApplication();
     }
 
     @Test
+    @Ignore
     public void testSearchSimple() {
         ClientResponse response = resource().path(getAPIVersion())
                 .path("search").queryParam("q", "[orth=das]")
@@ -44,23 +39,26 @@
                 .header(Attributes.AUTHORIZATION,
                         BasicHttpAuth.encode("kustvakt", "kustvakt2015"))
                 .get(ClientResponse.class);
-        assert ClientResponse.Status.OK.getStatusCode() == response.getStatus();
+        assertEquals(ClientResponse.Status.OK.getStatusCode(),
+                response.getStatus());
 
         JsonNode node = JsonUtils.readTree(response.getEntity(String.class));
-        assert node.path("matches").size() > 0;
+        Assert.assertNotNull(node);
+        assertNotEquals(0, node.path("matches").size());
     }
 
     @Test
+    @Ignore
     public void testCollectionGet() {
         ClientResponse response = resource().path(getAPIVersion())
                 .path("collection").header(Attributes.AUTHORIZATION,
                         BasicHttpAuth.encode("kustvakt", "kustvakt2015"))
                 .get(ClientResponse.class);
-        assert ClientResponse.Status.OK.getStatusCode() == response.getStatus();
+        assertEquals(ClientResponse.Status.OK.getStatusCode(),
+                response.getStatus());
 
         JsonNode node = JsonUtils.readTree(response.getEntity(String.class));
-
-        assert node.size() > 0;
+        assertNotEquals(0, node.size());
     }
 
     @Test
@@ -70,10 +68,11 @@
                 .path("collection").header(Attributes.AUTHORIZATION,
                         BasicHttpAuth.encode("kustvakt", "kustvakt2015"))
                 .get(ClientResponse.class);
-        assert ClientResponse.Status.OK.getStatusCode() == response.getStatus();
+        assertEquals(ClientResponse.Status.OK.getStatusCode(),
+                response.getStatus());
 
         JsonNode node = JsonUtils.readTree(response.getEntity(String.class));
-        assert node != null;
+        Assert.assertNotNull(node);
 
         System.out.println("-------------------------------");
         System.out.println("NODE COLLECTIONS" + node);
@@ -86,13 +85,15 @@
                         BasicHttpAuth.encode("kustvakt", "kustvakt2015"))
                 .get(ClientResponse.class);
 
-        assert ClientResponse.Status.OK.getStatusCode() == response.getStatus();
+        assertEquals(ClientResponse.Status.OK.getStatusCode(),
+                response.getStatus());
         node = JsonUtils.readTree(response.getEntity(String.class));
-        assert node != null;
+        Assert.assertNotNull(node);
         int docs = node.path("documents").asInt();
         System.out.println("-------------------------------");
         System.out.println("NODE " + node);
-        assert docs > 0 && docs < 15;
+        assertNotEquals(0, docs);
+        Assert.assertTrue(docs < 15);
     }
 
     @Test
@@ -100,4 +101,61 @@
 
     }
 
+    @Test
+    @Ignore
+    public void testSerializationQueryInCollection() {
+        ClientResponse response = resource().path(getAPIVersion())
+                .path("corpus/WPD/search").queryParam("q", "[base=Haus]")
+                .queryParam("ql", "poliqarp").queryParam("context", "base/s:s")
+                .method("TRACE", ClientResponse.class);
+        System.out.println("RESPONSE 1 " + response);
+        String ent = response.getEntity(String.class);
+        System.out.println("Entity 1 " + ent);
+    }
+
+    @Test
+    public void testSerializationQueryPublic() {
+        ClientResponse response = resource().path(getAPIVersion())
+                .path("search").queryParam("q", "[base=Haus]")
+                .queryParam("ql", "poliqarp").queryParam("context", "sentence")
+                .method("TRACE", ClientResponse.class);
+        String ent = response.getEntity(String.class);
+        JsonNode node = JsonUtils.readTree(ent);
+        System.out.println("PUBLIC COLLECTION");
+        System.out.println(node);
+    }
+
+    @Test
+    public void testQuery() {
+        ClientResponse response = resource().path(getAPIVersion())
+                .path("search").queryParam("q", "[base=Haus]")
+                .queryParam("ql", "poliqarp").queryParam("context", "sentence")
+                .get(ClientResponse.class);
+        String ent = response.getEntity(String.class);
+        JsonNode node = JsonUtils.readTree(ent);
+        assertNotNull(node);
+        assertEquals("base/s:s", node.at("/meta/context").asText());
+        assertNotEquals("${project.version}", "/meta/version");
+    }
+
+    @Test
+    @Ignore
+    public void testSerializationMeta() {
+        ClientResponse response = resource().path(getAPIVersion())
+                .path("search").queryParam("context", "sentence")
+                .queryParam("q", "[pos=ADJA]").queryParam("ql", "poliqarp")
+                .get(ClientResponse.class);
+    }
+
+    @Test
+    @Ignore
+    public void testSerializationCollection() {
+        ClientResponse response = resource().path(getAPIVersion()).path("")
+                .get(ClientResponse.class);
+    }
+
+    @Override
+    public void initMethod() throws KustvaktException {
+        helper().runBootInterfaces();
+    }
 }
diff --git a/src/test/resources/default-config.xml b/src/test/resources/default-config.xml
index ce2dc35..f669953 100644
--- a/src/test/resources/default-config.xml
+++ b/src/test/resources/default-config.xml
@@ -40,7 +40,7 @@
         <property name="locations">
             <array>
                 <value>classpath:jdbc.properties</value>
-                <value>file:./jdbc.properties</value>
+                <value>file:./jdbc_tests.properties</value>
             </array>
         </property>
     </bean>
@@ -62,13 +62,17 @@
 
     <!--class="org.apache.commons.dbcp2.BasicDataSource"-->
     <!-- org.springframework.jdbc.datasource.SingleConnectionDataSource -->
+    <!-- org.springframework.jdbc.datasource.DriverManagerDataSource -->
     <bean id="dataSource"
           class="org.springframework.jdbc.datasource.SingleConnectionDataSource"
-          lazy-init="true">
-        <property name="driverClassName" value="${jdbc.driverClassName}"/>
-        <property name="url" value="${jdbc.url}"/>
-        <property name="username" value="${jdbc.username}"/>
-        <property name="password" value="${jdbc.password}"/>
+          lazy-init="false">
+        <property name="driverClassName" value="org.sqlite.JDBC"/>
+        <property name="url" value="jdbc:sqlite:tmp_new.sqlite"/>
+        <!--<property name="initialSize" value="1" />-->
+        <!--<property name="maxTotal" value="1" />-->
+        <!--<property name="maxIdle" value="1" />-->
+        <!--<property name="username" value="${jdbc.username}"/>-->
+        <!--<property name="password" value="${jdbc.password}"/>-->
         <!-- relevant for single connection datasource and sqlite -->
         <property name="suppressClose">
             <value>true</value>
@@ -82,15 +86,14 @@
     <bean id="flyway" class="org.flywaydb.core.Flyway" init-method="migrate">
         <property name="baselineOnMigrate" value="false"/>
         <property name="locations"
-                  value="classpath:${jdbc.schemaPath}"/>
+                  value="classpath:db.sqlite"/>
         <property name="dataSource" ref="dataSource"/>
     </bean>
 
     <bean id="kustvakt_db"
           class="de.ids_mannheim.korap.handlers.JDBCClient">
         <constructor-arg index="0" ref="dataSource"/>
-        <!-- deprecated property -->
-        <property name="database" value="${jdbc.database}"/>
+        <property name="database" value="jdbc:sqlite::memory:"/>
     </bean>
 
     <bean id="kustvakt_userdetails"
@@ -114,8 +117,8 @@
     </bean>
 
     <!--<bean id="collectionProvider"-->
-          <!--class="de.ids_mannheim.korap.handlers.CollectionDao">-->
-        <!--<constructor-arg ref="kustvakt_db"/>-->
+    <!--class="de.ids_mannheim.korap.handlers.CollectionDao">-->
+    <!--<constructor-arg ref="kustvakt_db"/>-->
     <!--</bean>-->
 
     <!--fixme: change name according to convention -->
@@ -166,7 +169,7 @@
                 ref="kustvakt_encryption"/>
     </bean>
 
-    <util:list id="auth_providers"
+    <util:list id="kustvakt_authproviders"
                value-type="de.ids_mannheim.korap.interfaces.AuthenticationIface">
         <ref bean="basic_auth"/>
         <ref bean="session_auth"/>
@@ -174,6 +177,26 @@
         <ref bean="openid_auth"/>
     </util:list>
 
+    <bean id="userdata_details"
+          class="de.ids_mannheim.korap.handlers.UserDetailsDao">
+        <constructor-arg
+                type="de.ids_mannheim.korap.interfaces.db.PersistenceClient"
+                ref="kustvakt_db"/>
+    </bean>
+    <bean id="userdata_settings"
+          class="de.ids_mannheim.korap.handlers.UserDetailsDao">
+        <constructor-arg
+                type="de.ids_mannheim.korap.interfaces.db.PersistenceClient"
+                ref="kustvakt_db"/>
+    </bean>
+
+    <util:list id="kustvakt_userdata"
+               value-type="de.ids_mannheim.korap.interfaces.db.UserdataDbIface">
+        <ref bean="userdata_details"/>
+        <ref bean="userdata_settings"/>
+    </util:list>
+
+
     <!-- specify type for constructor argument -->
     <bean id="kustvakt_authenticationmanager"
           class="de.ids_mannheim.korap.security.auth.KustvaktAuthenticationManager">
@@ -186,8 +209,9 @@
         <constructor-arg
                 type="de.ids_mannheim.korap.interfaces.db.AuditingIface"
                 ref="kustvakt_auditing"/>
+        <constructor-arg ref="kustvakt_userdata"/>
         <!-- inject authentication providers to use -->
-        <property name="providers" ref="auth_providers"/>
+        <property name="providers" ref="kustvakt_authproviders"/>
     </bean>
 
     <!-- todo: if db interfaces not loaded via spring, does transaction even work then? -->
