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
