diff --git a/core/src/main/java/de/ids_mannheim/korap/web/service/BootableBeanInterface.java b/core/src/main/java/de/ids_mannheim/korap/web/service/BootableBeanInterface.java
deleted file mode 100644
index 56915c3..0000000
--- a/core/src/main/java/de/ids_mannheim/korap/web/service/BootableBeanInterface.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package de.ids_mannheim.korap.web.service;
-
-import de.ids_mannheim.korap.config.ContextHolder;
-import de.ids_mannheim.korap.exceptions.KustvaktException;
-
-/**
- * @author hanl
- * @date 12/01/2016
- */
-@Deprecated
-public interface BootableBeanInterface {
-
-    void load (ContextHolder beans) throws KustvaktException;
-
-
-    Class<? extends BootableBeanInterface>[] getDependencies ();
-
-}
diff --git a/core/src/main/java/de/ids_mannheim/korap/web/service/BootupInterface.java b/core/src/main/java/de/ids_mannheim/korap/web/service/BootupInterface.java
deleted file mode 100644
index 86b62d9..0000000
--- a/core/src/main/java/de/ids_mannheim/korap/web/service/BootupInterface.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package de.ids_mannheim.korap.web.service;
-
-import de.ids_mannheim.korap.exceptions.KustvaktException;
-
-/**
- * @author hanl
- * @date 12/01/2016
- */
-@Deprecated
-public interface BootupInterface {
-
-    void load () throws KustvaktException;
-
-
-    Class<? extends BootupInterface>[] getDependencies ();
-
-}
diff --git a/core/src/main/java/de/ids_mannheim/korap/web/service/CollectionLoader.java b/core/src/main/java/de/ids_mannheim/korap/web/service/CollectionLoader.java
deleted file mode 100644
index 5485896..0000000
--- a/core/src/main/java/de/ids_mannheim/korap/web/service/CollectionLoader.java
+++ /dev/null
@@ -1,129 +0,0 @@
-package de.ids_mannheim.korap.web.service;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStreamReader;
-
-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.KustvaktResource;
-import de.ids_mannheim.korap.resources.Permissions.Permission;
-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.User;
-import de.ids_mannheim.korap.utils.JsonUtils;
-import de.ids_mannheim.korap.utils.KoralCollectionQueryBuilder;
-
-/**
- * @author hanl, margaretha
- * @date 12/01/2016
- * @lastupdate 19/04/2017
- */
-@Deprecated
-public class CollectionLoader implements BootableBeanInterface {
-
-    @Override
-    @Deprecated
-    public void load (ContextHolder beans) throws KustvaktException {
-        SecurityManager.overrideProviders(beans);
-        ResourceFinder.overrideProviders(beans);
-
-        User user = User.UserFactory
-                .toUser(KustvaktConfiguration.KUSTVAKT_USER);
-
-        KustvaktConfiguration config = beans.getConfiguration();
-        PolicyBuilder builder = new PolicyBuilder(user);
-        String result = null;
-        BufferedReader br;
-        try {
-            File f = new File(config.getPolicyConfig());
-            br = new BufferedReader(
-                    new InputStreamReader(new FileInputStream(f)));
-        }
-        catch (FileNotFoundException e) {
-            throw new KustvaktException("Policy config file: "
-                    + config.getPolicyConfig() + " does not exists!",
-                    e.getCause(), 101);
-        }
-        String policy = null, collectionQuery = null;
-        String[] policyData = null;
-        String type, id, name, description, condition;
-        String[] permissions;
-        try {
-            while ((policy = br.readLine()) != null) {
-                if (policy.startsWith("#") || policy.isEmpty())
-                    continue;
-                policyData = policy.split("\t");
-                type = policyData[0];
-                id = policyData[1];
-                name = policyData[2];
-                description = policyData[3];
-                condition = policyData[4];
-                permissions = policyData[5].split(",");
-                if (policyData.length > 6)
-                    collectionQuery = policyData[6];
-
-                Permission[] permissionArr = new Permission[permissions.length];
-                for (int i = 0; i < permissions.length; i++) {
-                    if (permissions[i].equals("read")) {
-                        permissionArr[i] = Permission.READ;
-                    }
-                }
-
-                KustvaktResource resource = createResource(type, id, name,
-                        description, collectionQuery);
-                if (resource != null) {
-                    builder = new PolicyBuilder(user);
-                    builder.addCondition(condition);
-                    builder.setResources(resource);
-                    builder.setPermissions(permissionArr);
-                    result = builder.create();
-                    if (JsonUtils.readTree(result).size() > 0)
-                        throw new KustvaktException(StatusCodes.REQUEST_INVALID,
-                                "creating collections caused errors", result);
-                }
-            }
-            br.close();
-        }
-        catch (IOException e) {
-            throw new KustvaktException("Failed creating virtual collections.",
-                    e.getCause(), 100);
-        }
-    }
-
-
-    private KustvaktResource createResource (String type, String id,
-            String name, String description, String docQuery) {
-        KoralCollectionQueryBuilder builder;
-        KustvaktResource resource = null;
-        if (type.equals("virtualcollection")) {
-            resource = new VirtualCollection(id);
-            if (!name.isEmpty()) {
-                resource.setName(name);
-            }
-            if (!description.isEmpty()) {
-                resource.setDescription(description);
-            }
-            if (docQuery != null && !docQuery.isEmpty()) {
-                builder = new KoralCollectionQueryBuilder();
-                builder.with(docQuery);
-                resource.setFields(builder.toJSON());
-            }
-        }
-
-        return resource;
-    }
-
-
-    @Override
-    public Class<? extends BootableBeanInterface>[] getDependencies () {
-        return new Class[] { UserLoader.class };
-    }
-}
diff --git a/core/src/main/java/de/ids_mannheim/korap/web/service/PolicyLoader.java b/core/src/main/java/de/ids_mannheim/korap/web/service/PolicyLoader.java
deleted file mode 100644
index 91f7205..0000000
--- a/core/src/main/java/de/ids_mannheim/korap/web/service/PolicyLoader.java
+++ /dev/null
@@ -1,125 +0,0 @@
-package de.ids_mannheim.korap.web.service;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStreamReader;
-
-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.Layer;
-import de.ids_mannheim.korap.resources.VirtualCollection;
-import de.ids_mannheim.korap.resources.Permissions.Permission;
-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;
-import de.ids_mannheim.korap.utils.KoralCollectionQueryBuilder;
-
-/**
- * @author hanl
- * @date 15/01/2016
- */
-@Deprecated
-public class PolicyLoader implements BootableBeanInterface {
-
-	@Override
-	public void load(ContextHolder beans) throws KustvaktException {
-		SecurityManager.overrideProviders(beans);
-		ResourceFinder.overrideProviders(beans);
-
-		User user = User.UserFactory.toUser(KustvaktConfiguration.KUSTVAKT_USER);
-		KustvaktConfiguration config = beans.getConfiguration();
-		PolicyBuilder builder = new PolicyBuilder(user);
-		BufferedReader br;
-		try {
-			File f = new File(config.getPolicyConfig());
-			br = new BufferedReader(new InputStreamReader(new FileInputStream(f)));
-		} catch (FileNotFoundException e) {
-			throw new KustvaktException("Policy config file: " + config.getPolicyConfig() + " does not exists!",
-					e.getCause(), 101);
-		}
-		String policy = null;
-		String[] policyData = null;
-		String type, id, name, description, condition;
-		String[] permissions;
-		try {
-			while ((policy = br.readLine()) != null) {
-				if (policy.startsWith("#") || policy.isEmpty()){
-					continue;
-				}
-				
-				policyData = policy.split("\t");
-				type = policyData[0];
-				id = policyData[1];
-				name = policyData[2];
-				description = policyData[3];
-				condition = policyData[4];
-				permissions = policyData[5].split(",");
-				
-				String collectionQuery = null;
-				if (policyData.length > 6)
-					collectionQuery = policyData[6];
-
-				Permission[] permissionArr = new Permission[permissions.length];
-				for (int i = 0; i < permissions.length; i++) {
-					if (permissions[i].equals("read")) {
-						permissionArr[i] = Permission.READ;
-					}
-				}
-				KustvaktResource resource = createResource(type, id, name, description, collectionQuery);
-				if (resource != null) {
-					builder.addCondition(condition);
-					builder.setResources(resource);
-					builder.setPermissions(permissionArr);
-					builder.create();
-				}
-			}
-			br.close();
-		} catch (IOException e) {
-			throw new KustvaktException("Failed creating policies.", e.getCause(), 100);
-		}
-	}
-
-	private KustvaktResource createResource(String type, String id, String name, String description, String docQuery) {
-		
-		KustvaktResource resource = null;
-		if (type.equals("corpus")) {
-			resource = new Corpus(id);
-		} else if (type.equals("foundry")) {
-			resource = new Foundry(id);
-		} else if (type.equals("layer")) {
-			resource = new Layer(id);
-		} else if (type.equals("virtualcollection")) {
-			KoralCollectionQueryBuilder builder;
-			resource = new VirtualCollection(id);
-			if (docQuery != null && !docQuery.isEmpty()) {
-				builder = new KoralCollectionQueryBuilder();
-				builder.with(docQuery);
-				resource.setFields(builder.toJSON());
-			}
-		} else {
-			return resource;
-		}
-
-		if (!name.isEmpty()) {
-			resource.setName(name);
-		}
-		if (!description.isEmpty()) {
-			resource.setDescription(description);
-		}
-
-		return resource;
-	}
-
-	@Override
-	public Class<? extends BootableBeanInterface>[] getDependencies() {
-		return new Class[] { UserLoader.class };
-	}
-}
diff --git a/core/src/main/java/de/ids_mannheim/korap/web/service/UserLoader.java b/core/src/main/java/de/ids_mannheim/korap/web/service/UserLoader.java
deleted file mode 100644
index cab1e1b..0000000
--- a/core/src/main/java/de/ids_mannheim/korap/web/service/UserLoader.java
+++ /dev/null
@@ -1,47 +0,0 @@
-package de.ids_mannheim.korap.web.service;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import de.ids_mannheim.korap.config.Attributes;
-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;
-
-/**
- * @author hanl
- * @date 12/01/2016
- */
-@Deprecated
-public class UserLoader implements BootableBeanInterface {
-
-    @Override
-    public void load (ContextHolder beans) throws KustvaktException {
-        AuthenticationManagerIface manager = beans.getAuthenticationManager();
-        manager.createUserAccount(KustvaktConfiguration.KUSTVAKT_USER, false);
-        
-        // EM: Fix me
-        // EM: Hack for LDAP User
-        // 
-        Map<String, Object> ldapUser = new HashMap<>();
-        ldapUser.put(Attributes.ID, 101);
-        ldapUser.put(Attributes.USERNAME, "LDAPDefaultUser");
-        ldapUser.put(Attributes.PASSWORD, "unnecessary123");
-        ldapUser.put(Attributes.EMAIL, "korap@ids-mannheim.de");
-        ldapUser.put(Attributes.COUNTRY, "unnecessary");
-        ldapUser.put(Attributes.ADDRESS, "unnecessary");
-        ldapUser.put(Attributes.FIRSTNAME, "unnecessary");
-        ldapUser.put(Attributes.LASTNAME, "unnecessary");
-        ldapUser.put(Attributes.INSTITUTION, "IDS");
-        ldapUser.put(Attributes.IS_ADMIN, "false");
-        
-        manager.createUserAccount(ldapUser, false);
-    }
-
-
-    @Override
-    public Class<? extends BootableBeanInterface>[] getDependencies () {
-        return new Class[0];
-    }
-}
diff --git a/full/src/main/java/de/ids_mannheim/korap/server/KustvaktServer.java b/full/src/main/java/de/ids_mannheim/korap/server/KustvaktServer.java
index a43d6f0..4b3a6d6 100644
--- a/full/src/main/java/de/ids_mannheim/korap/server/KustvaktServer.java
+++ b/full/src/main/java/de/ids_mannheim/korap/server/KustvaktServer.java
@@ -1,15 +1,7 @@
 package de.ids_mannheim.korap.server;
 
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-
 import de.ids_mannheim.korap.config.BeansFactory;
-import de.ids_mannheim.korap.config.ContextHolder;
-import de.ids_mannheim.korap.config.KustvaktClassLoader;
-import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.web.KustvaktBaseServer;
-import de.ids_mannheim.korap.web.service.BootableBeanInterface;
 
 /**
  * pu
@@ -40,14 +32,14 @@
 
     @Override
     protected void setup () {
-        Set<Class<? extends BootableBeanInterface>> set = KustvaktClassLoader
-                .loadSubTypes(BootableBeanInterface.class);
-
-        ContextHolder context = BeansFactory.getKustvaktContext();
-        if (context == null)
-            throw new RuntimeException("Beans could not be loaded!");
-
-        List<BootableBeanInterface> list = new ArrayList<>(set.size());
+//        Set<Class<? extends BootableBeanInterface>> set = KustvaktClassLoader
+//                .loadSubTypes(BootableBeanInterface.class);
+//
+//        ContextHolder context = BeansFactory.getKustvaktContext();
+//        if (context == null)
+//            throw new RuntimeException("Beans could not be loaded!");
+//
+//        List<BootableBeanInterface> list = new ArrayList<>(set.size());
 //        for (Class cl : set) {
 //            BootableBeanInterface iface;
 //            
@@ -62,29 +54,29 @@
 //                continue;
 //            }
 //        }
-        System.out.println("Found boot loading interfaces: " + list);
-
-        while (!list.isEmpty()) {
-            loop: for (BootableBeanInterface iface : new ArrayList<>(list)) {
-                try {
-                    for (Class dep : iface.getDependencies()) {
-                        if (set.contains(dep))
-                            continue loop;
-                    }
-                    iface.load(context);
-                    list.remove(iface);
-                    set.remove(iface.getClass());
-                    System.out.println("Done with interface "
-                            + iface.getClass().getSimpleName());
-                }
-                catch (KustvaktException e) {
-                    // don't do anything!
-                    System.out.println("An error occurred in class "
-                            + iface.getClass().getSimpleName() + "!\n");
-                    e.printStackTrace();
-                    System.exit(-1);
-                }
-            }
-        }
+//        System.out.println("Found boot loading interfaces: " + list);
+//
+//        while (!list.isEmpty()) {
+//            loop: for (BootableBeanInterface iface : new ArrayList<>(list)) {
+//                try {
+//                    for (Class dep : iface.getDependencies()) {
+//                        if (set.contains(dep))
+//                            continue loop;
+//                    }
+//                    iface.load(context);
+//                    list.remove(iface);
+//                    set.remove(iface.getClass());
+//                    System.out.println("Done with interface "
+//                            + iface.getClass().getSimpleName());
+//                }
+//                catch (KustvaktException e) {
+//                    // don't do anything!
+//                    System.out.println("An error occurred in class "
+//                            + iface.getClass().getSimpleName() + "!\n");
+//                    e.printStackTrace();
+//                    System.exit(-1);
+//                }
+//            }
+//        }
     }
 }
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/service/full/SearchService.java b/full/src/main/java/de/ids_mannheim/korap/web/service/full/SearchService.java
index ab33369..8dde18a 100644
--- a/full/src/main/java/de/ids_mannheim/korap/web/service/full/SearchService.java
+++ b/full/src/main/java/de/ids_mannheim/korap/web/service/full/SearchService.java
@@ -611,90 +611,6 @@
 
     }
 
-
-    /**
-     * String search, String ql, List<String> parents, String cli,
-     * String cri,
-     * int cls, int crs, int num, int page, boolean cutoff) param
-     * context will
-     * be like this: context: "3-t,2-c"
-     * <p/>
-     * id does not have to be an integer. name is also possible, in
-     * which case a
-     * type reference is required
-     * 
-     * @param securityContext
-     * @param locale
-     * @return
-     */
-    // todo: remove raw
-//    @GET
-//    @Path("/{type}/{id}/search")
-    @Deprecated //EM
-    public Response searchbyName (@Context SecurityContext securityContext,
-            @Context Locale locale, @QueryParam("q") String query,
-            @QueryParam("ql") String ql, @QueryParam("v") String v,
-            @QueryParam("context") String ctx,
-            @QueryParam("cutoff") Boolean cutoff,
-            @QueryParam("count") Integer pageLength,
-            @QueryParam("offset") Integer pageIndex,
-            @QueryParam("page") Integer pageInteger, @PathParam("id") String id,
-            @PathParam("type") String type, @QueryParam("cq") String cq,
-            @QueryParam("raw") Boolean raw,
-            @QueryParam("engine") String engine) {
-        // ref is a virtual collection id!
-        TokenContext context = (TokenContext) securityContext
-                .getUserPrincipal();
-        KustvaktConfiguration.BACKENDS eng = this.config.chooseBackend(engine);
-        type = StringUtils.normalize(type);
-        id = StringUtils.decodeHTML(id);
-        raw = raw == null ? false : raw;
-
-        try {
-            User user = controller.getUser(context.getUsername());
-            MetaQueryBuilder meta;
-
-            if (!raw) {
-                meta = createMetaQuery(pageIndex, pageInteger, ctx, pageLength,
-                        cutoff);
-
-                QuerySerializer s = new QuerySerializer();
-                s.setQuery(query, ql, v);
-
-                // add collection query
-                KoralCollectionQueryBuilder builder = new KoralCollectionQueryBuilder();
-                builder.setBaseQuery(s.toJSON());
-                //query = createQuery(user, type, id, builder);
-                builder.with(Attributes.CORPUS_SIGLE, "=", id);
-                builder.toJSON();
-
-            }
-            else {
-                meta = new MetaQueryBuilder();
-            }
-
-            try {
-                // rewrite process
-                query = this.processor.processQuery(query, user);
-            }
-            catch (KustvaktException e) {
-                jlog.error("Failed in rewriting query: " + query, e);
-                throw KustvaktResponseHandler.throwit(500, e.getMessage(),
-                        null);
-            }
-
-            String result = doSearch(eng, query, pageLength, meta);
-            jlog.debug("The result set: {}", result);
-            return Response.ok(result).build();
-        }
-        catch (KustvaktException e) {
-            jlog.error("Exception encountered: {}", e.string());
-            throw KustvaktResponseHandler.throwit(e);
-        }
-
-    }
-
-
     @Deprecated
     private String createQuery (User user, String type, String id,
             KoralCollectionQueryBuilder builder) {
diff --git a/full/src/test/java/de/ids_mannheim/korap/config/CollectionLoaderTest.java b/full/src/test/java/de/ids_mannheim/korap/config/CollectionLoaderTest.java
deleted file mode 100644
index 82af51b..0000000
--- a/full/src/test/java/de/ids_mannheim/korap/config/CollectionLoaderTest.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package de.ids_mannheim.korap.config;
-
-import de.ids_mannheim.korap.exceptions.KustvaktException;
-import de.ids_mannheim.korap.handlers.ResourceDao;
-import de.ids_mannheim.korap.web.service.CollectionLoader;
-import de.ids_mannheim.korap.web.service.UserLoader;
-import org.junit.Assert;
-import org.junit.Ignore;
-import org.junit.Test;
-
-/**
- * @author hanl
- * @date 11/02/2016
- */
-@Deprecated
-@Ignore
-public class CollectionLoaderTest extends BeanConfigTest {
-
-    @Test
-    public void testCollectionLoader () {
-        ResourceDao dao = new ResourceDao(helper().getContext()
-                .getPersistenceClient());
-
-        boolean error = false;
-        UserLoader u = new UserLoader();
-        CollectionLoader l = new CollectionLoader();
-        try {
-            u.load(helper().getContext());
-            l.load(helper().getContext());
-        }
-        catch (KustvaktException e) {
-            error = true;
-        }
-        Assert.assertFalse(error);
-        Assert.assertNotEquals("Is not supposed to be zero", 0, dao.size());
-    }
-
-
-    @Override
-    public void initMethod () throws KustvaktException {
-
-    }
-}
diff --git a/full/src/test/java/de/ids_mannheim/korap/config/ConfigTest.java b/full/src/test/java/de/ids_mannheim/korap/config/ConfigTest.java
index eabb0a3..991165b 100644
--- a/full/src/test/java/de/ids_mannheim/korap/config/ConfigTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/config/ConfigTest.java
@@ -1,20 +1,26 @@
 package de.ids_mannheim.korap.config;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.security.NoSuchAlgorithmException;
+import java.util.Map;
+import java.util.Properties;
+
+import org.codehaus.plexus.util.IOUtil;
+import org.junit.Ignore;
+import org.junit.Test;
+
 import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.interfaces.EncryptionIface;
 import de.ids_mannheim.korap.utils.ServiceInfo;
 import de.ids_mannheim.korap.utils.TimeUtils;
-import de.ids_mannheim.korap.web.service.BootableBeanInterface;
-import org.codehaus.plexus.util.IOUtil;
-import org.junit.Assert;
-import org.junit.Ignore;
-import org.junit.Test;
-
-import java.io.*;
-import java.security.NoSuchAlgorithmException;
-import java.util.*;
-
-import static org.junit.Assert.*;
 
 /**
  * @author hanl
@@ -81,45 +87,6 @@
                                 "kustvakt.conf"));
     }
 
-
-    @Test
-    public void testBootConfigRun () throws KustvaktException {
-//        helper().runBootInterfaces();
-        helper().setupAccount();
-        assertNotNull(helper().getUser());
-
-        Set<Class<? extends BootableBeanInterface>> set = KustvaktClassLoader
-                .loadSubTypes(BootableBeanInterface.class);
-
-        int check = set.size();
-        List<String> tracker = new ArrayList<>();
-        List<BootableBeanInterface> list = new ArrayList<>(set.size());
-        for (Class cl : set) {
-            BootableBeanInterface iface;
-            try {
-                iface = (BootableBeanInterface) cl.newInstance();
-                list.add(iface);
-            }
-            catch (InstantiationException | IllegalAccessException e) {
-                // do nothing
-            }
-        }
-
-        while (!set.isEmpty()) {
-            out_loop: for (BootableBeanInterface iface : new ArrayList<>(list)) {
-                for (Class cl : iface.getDependencies()) {
-                    if (set.contains(cl))
-                        continue out_loop;
-                }
-                tracker.add(iface.getClass().getSimpleName());
-                set.remove(iface.getClass());
-                list.remove(iface);
-            }
-        }
-        assertEquals(check, tracker.size());
-    }
-
-    // todo:
     @Test
     @Ignore
     public void testKustvaktValueValidation() {
diff --git a/full/src/test/java/de/ids_mannheim/korap/config/LoaderTest.java b/full/src/test/java/de/ids_mannheim/korap/config/LoaderTest.java
deleted file mode 100644
index 9be6496..0000000
--- a/full/src/test/java/de/ids_mannheim/korap/config/LoaderTest.java
+++ /dev/null
@@ -1,92 +0,0 @@
-package de.ids_mannheim.korap.config;
-
-import de.ids_mannheim.korap.exceptions.KustvaktException;
-import de.ids_mannheim.korap.web.service.BootableBeanInterface;
-import de.ids_mannheim.korap.web.service.CollectionLoader;
-import de.ids_mannheim.korap.web.service.PolicyLoader;
-import de.ids_mannheim.korap.web.service.UserLoader;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.springframework.test.annotation.DirtiesContext;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotEquals;
-
-/**
- * @author hanl
- * @date 12/02/2016
- */
-public class LoaderTest extends BeanConfigTest {
-
-    @Test
-    @Ignore
-    public void testConfigOrder () {
-        System.out.println("done ...");
-
-        List s = new ArrayList<>();
-        s.add("new");
-        s.add("new2");
-    }
-
-
-    @Override
-    public void initMethod () throws KustvaktException {}
-
-
-    @Test
-    @Ignore
-    @Deprecated
-    public void runBootInterfaces () {
-        Set<Class<? extends BootableBeanInterface>> set = new HashSet<>();
-        set.add(CollectionLoader.class);
-        set.add(PolicyLoader.class);
-        set.add(UserLoader.class);
-
-        List<BootableBeanInterface> list = new ArrayList<>(set.size());
-        for (Class cl : set) {
-            BootableBeanInterface iface;
-            try {
-                iface = (BootableBeanInterface) cl.newInstance();
-                list.add(iface);
-            }
-            catch (InstantiationException | IllegalAccessException e) {
-                // do nothing
-            }
-        }
-        assertEquals(set.size(), list.size());
-        List tracer = new ArrayList();
-        System.out.println("Found boot loading interfaces: " + list);
-        while (!set.isEmpty()) {
-            out_loop: for (BootableBeanInterface iface : new ArrayList<>(list)) {
-                try {
-                    for (Class cl : iface.getDependencies()) {
-                        if (set.contains(cl))
-                            continue out_loop;
-                    }
-                    System.out.println("Running boot instructions from class "
-                            + iface.getClass().getSimpleName());
-                    set.remove(iface.getClass());
-                    list.remove(iface);
-                    iface.load(helper().getContext());
-                    tracer.add(iface.getClass());
-                }
-                catch (KustvaktException e) {
-                    // don't do anything!
-                    System.out.println("An error occurred in class "
-                            + iface.getClass().getSimpleName() + "!\n" + e);
-                    throw new RuntimeException(
-                            "Boot loading interface failed ...");
-                }
-            }
-        }
-        assertEquals(0, tracer.indexOf(UserLoader.class));
-        assertNotEquals(0, tracer.indexOf(CollectionLoader.class));
-        assertNotEquals(0, tracer.indexOf(PolicyLoader.class));
-    }
-
-}
diff --git a/full/src/test/java/de/ids_mannheim/korap/config/PolicyLoaderTest.java b/full/src/test/java/de/ids_mannheim/korap/config/PolicyLoaderTest.java
deleted file mode 100644
index f9a1a09..0000000
--- a/full/src/test/java/de/ids_mannheim/korap/config/PolicyLoaderTest.java
+++ /dev/null
@@ -1,50 +0,0 @@
-package de.ids_mannheim.korap.config;
-
-import de.ids_mannheim.korap.exceptions.KustvaktException;
-import de.ids_mannheim.korap.security.ac.PolicyDao;
-import de.ids_mannheim.korap.web.service.CollectionLoader;
-import de.ids_mannheim.korap.web.service.PolicyLoader;
-import de.ids_mannheim.korap.web.service.UserLoader;
-import org.junit.Test;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotEquals;
-
-import org.junit.Ignore;
-
-/**
- * @author hanl
- * @date 11/02/2016
- */
-@Deprecated
-@Ignore
-public class PolicyLoaderTest extends BeanConfigTest {
-
-    @Test
-    @Ignore
-    public void testPolicyLoader () {
-        boolean error = false;
-        UserLoader u = new UserLoader();
-        CollectionLoader c = new CollectionLoader();
-        PolicyLoader l = new PolicyLoader();
-        try {
-            u.load(helper().getContext());
-            c.load(helper().getContext());
-            l.load(helper().getContext());
-        }
-        catch (KustvaktException e) {
-            e.printStackTrace();
-            error = true;
-        }
-        assertFalse(error);
-        PolicyDao dao = new PolicyDao(helper().getContext()
-                .getPersistenceClient());
-        assertNotEquals("Is not supposed to be zero", 0, dao.size());
-    }
-
-
-    @Override
-    public void initMethod () throws KustvaktException {
-
-    }
-}
diff --git a/full/src/test/java/de/ids_mannheim/korap/config/TestHelper.java b/full/src/test/java/de/ids_mannheim/korap/config/TestHelper.java
index 69501ff..a490dfe 100644
--- a/full/src/test/java/de/ids_mannheim/korap/config/TestHelper.java
+++ b/full/src/test/java/de/ids_mannheim/korap/config/TestHelper.java
@@ -7,18 +7,14 @@
 
 import java.io.File;
 import java.io.IOException;
-import java.io.InputStream;
 import java.io.UnsupportedEncodingException;
 import java.security.NoSuchAlgorithmException;
 import java.sql.ResultSet;
 import java.sql.SQLException;
-import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.HashMap;
 import java.util.HashSet;
-import java.util.List;
 import java.util.Map;
-import java.util.Properties;
 import java.util.Set;
 
 import org.apache.commons.dbcp2.BasicDataSource;
@@ -27,43 +23,21 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.context.ApplicationContext;
-import org.springframework.context.annotation.Bean;
 import org.springframework.jdbc.core.RowCallbackHandler;
 import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
 import org.springframework.jdbc.datasource.SingleConnectionDataSource;
 
 import de.ids_mannheim.korap.exceptions.EmptyResultException;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
-import de.ids_mannheim.korap.handlers.AdminDao;
-import de.ids_mannheim.korap.handlers.DocumentDao;
-import de.ids_mannheim.korap.handlers.EntityDao;
-import de.ids_mannheim.korap.handlers.JDBCAuditing;
 import de.ids_mannheim.korap.handlers.JDBCClient;
 import de.ids_mannheim.korap.handlers.ResourceDao;
-import de.ids_mannheim.korap.handlers.UserDetailsDao;
-import de.ids_mannheim.korap.handlers.UserSettingsDao;
-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.AdminHandlerIface;
-import de.ids_mannheim.korap.interfaces.db.AuditingIface;
 import de.ids_mannheim.korap.interfaces.db.EntityHandlerIface;
 import de.ids_mannheim.korap.interfaces.db.PersistenceClient;
-import de.ids_mannheim.korap.interfaces.db.PolicyHandlerIface;
-import de.ids_mannheim.korap.interfaces.db.ResourceOperationIface;
-import de.ids_mannheim.korap.interfaces.db.UserDataDbIface;
-import de.ids_mannheim.korap.interfaces.defaults.KustvaktEncryption;
 import de.ids_mannheim.korap.resources.KustvaktResource;
-import de.ids_mannheim.korap.security.ac.PolicyDao;
-import de.ids_mannheim.korap.security.auth.APIAuthentication;
-import de.ids_mannheim.korap.security.auth.BasicHttpAuth;
 import de.ids_mannheim.korap.security.auth.KustvaktAuthenticationManager;
-import de.ids_mannheim.korap.security.auth.OpenIDconnectAuthentication;
-import de.ids_mannheim.korap.security.auth.SessionAuthentication;
 import de.ids_mannheim.korap.user.User;
 import de.ids_mannheim.korap.utils.TimeUtils;
-import de.ids_mannheim.korap.web.service.BootableBeanInterface;
-import de.ids_mannheim.korap.web.service.CollectionLoader;
 
 /**
  * creates a test user that can be used to access protected functions
@@ -248,52 +222,6 @@
         return new HashMap<>(data);
     }
 
-
-    @Deprecated
-    public TestHelper runBootInterfaces () {
-        Set<Class<? extends BootableBeanInterface>> set = KustvaktClassLoader
-                .loadSubTypes(BootableBeanInterface.class);
-
-        List<BootableBeanInterface> list = new ArrayList<>(set.size());
-        for (Class cl : set) {
-            BootableBeanInterface iface;
-            try {
-                iface = (BootableBeanInterface) cl.newInstance();
-                if (!(iface instanceof CollectionLoader)){
-                	list.add(iface);	
-                }
-            }
-            catch (InstantiationException | IllegalAccessException e) {
-                // do nothing
-            }
-        }
-        jlog.debug("Found boot loading interfaces: " + list);
-        while (!list.isEmpty()) {
-            out_loop: for (BootableBeanInterface iface : new ArrayList<>(list)) {
-                try {
-                    jlog.debug("Running boot instructions from class "
-                            + iface.getClass().getSimpleName());
-                    for (Class cl : iface.getDependencies()) {
-                        if (set.contains(cl))
-                            continue out_loop;
-                    }
-                    set.remove(iface.getClass());
-                    list.remove(iface);
-                    iface.load(beansHolder);
-                }
-                catch (KustvaktException e) {
-                    // don't do anything!
-                    System.out.println("An error occurred in class "
-                            + iface.getClass().getSimpleName() + "!\n" + e);
-                    throw new RuntimeException(
-                            "Boot loading interface failed ...");
-                }
-            }
-        }
-        return this;
-    }
-
-
     public int setupResource (KustvaktResource resource)
             throws KustvaktException {
         ResourceDao dao = new ResourceDao(
diff --git a/full/src/test/java/de/ids_mannheim/korap/config/UserLoaderTest.java b/full/src/test/java/de/ids_mannheim/korap/config/UserLoaderTest.java
deleted file mode 100644
index 96a3e87..0000000
--- a/full/src/test/java/de/ids_mannheim/korap/config/UserLoaderTest.java
+++ /dev/null
@@ -1,40 +0,0 @@
-package de.ids_mannheim.korap.config;
-
-import de.ids_mannheim.korap.exceptions.KustvaktException;
-import de.ids_mannheim.korap.handlers.EntityDao;
-import de.ids_mannheim.korap.web.service.UserLoader;
-import org.junit.Assert;
-import org.junit.Ignore;
-import org.junit.Test;
-
-/**
- * @author hanl
- * @date 11/02/2016
- */
-@Ignore
-public class UserLoaderTest extends BeanConfigTest {
-
-    @Test
-    public void testUserLoader () {
-        EntityDao dao = new EntityDao(helper().getContext()
-                .getPersistenceClient());
-
-        boolean error = false;
-        UserLoader l = new UserLoader();
-        try {
-            l.load(helper().getContext());
-        }
-        catch (KustvaktException e) {
-            e.printStackTrace();
-            error = true;
-        }
-        Assert.assertFalse(error);
-        Assert.assertNotEquals("Is not supposed to be zero", 0, dao.size());
-    }
-
-
-    @Override
-    public void initMethod () throws KustvaktException {
-
-    }
-}
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/service/full/SearchServiceTest.java b/full/src/test/java/de/ids_mannheim/korap/web/service/full/SearchServiceTest.java
index 82a9ebb..1362f33 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/service/full/SearchServiceTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/service/full/SearchServiceTest.java
@@ -462,6 +462,8 @@
         s.setQuery("[orth=der]", "poliqarp");
         s.setCollection("corpusSigle=GOE");
 
+        s.setQuery("Wasser", "poliqarp");
+        System.out.println(s.toJSON());
         ClientResponse response = resource()
                 .path("search").post(ClientResponse.class, s.toJSON());
         assertEquals(ClientResponse.Status.OK.getStatusCode(),
