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 8081e5d..4d777b0 100644
--- a/src/main/java/de/ids_mannheim/korap/config/BeanConfiguration.java
+++ b/src/main/java/de/ids_mannheim/korap/config/BeanConfiguration.java
@@ -1,6 +1,5 @@
 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.*;
diff --git a/src/main/java/de/ids_mannheim/korap/exceptions/KustvaktException.java b/src/main/java/de/ids_mannheim/korap/exceptions/KustvaktException.java
index 68a3018..8e4148c 100644
--- a/src/main/java/de/ids_mannheim/korap/exceptions/KustvaktException.java
+++ b/src/main/java/de/ids_mannheim/korap/exceptions/KustvaktException.java
@@ -67,8 +67,8 @@
     }
 
 
-    @Override
-    public String toString () {
+
+    public String string () {
         return "Excpt{" + "status=" + getStatusCode() + ", message="
                 + getMessage() + ", args=" + getEntity() + ", userid=" + userid
                 + '}';
diff --git a/src/main/java/de/ids_mannheim/korap/exceptions/WrappedException.java b/src/main/java/de/ids_mannheim/korap/exceptions/WrappedException.java
index 60c0715..3e067a7 100644
--- a/src/main/java/de/ids_mannheim/korap/exceptions/WrappedException.java
+++ b/src/main/java/de/ids_mannheim/korap/exceptions/WrappedException.java
@@ -30,7 +30,7 @@
         this(e.getUserid(), e.getStatusCode(), e.getMessage(), e.getEntity());
         AuditRecord record = AuditRecord.serviceRecord(e.getUserid(), status,
                 args);
-        record.setField_1(e.toString());
+        record.setField_1(e.string());
         this.records.addAll(e.getRecords());
         this.records.add(record);
     }
diff --git a/src/main/java/de/ids_mannheim/korap/exceptions/dbException.java b/src/main/java/de/ids_mannheim/korap/exceptions/dbException.java
index f6fdf23..076797b 100644
--- a/src/main/java/de/ids_mannheim/korap/exceptions/dbException.java
+++ b/src/main/java/de/ids_mannheim/korap/exceptions/dbException.java
@@ -31,14 +31,14 @@
     public dbException (KustvaktException e, Integer status, String ... args) {
         this(e.getUserid(), e.getStatusCode(), e.getMessage(), e.getEntity());
         AuditRecord record = AuditRecord.dbRecord(e.getUserid(), status, args);
-        record.setField_1(e.toString());
+        record.setField_1(e.string());
         this.records.addAll(e.getRecords());
         this.records.add(record);
     }
 
 
     @Override
-    public String toString () {
+    public String string () {
         return "DBExcpt{" + "status=" + getStatusCode() + ", message="
                 + getMessage() + ", args=" + getEntity() + ", userid="
                 + this.getUserid() + '}';
diff --git a/src/main/java/de/ids_mannheim/korap/security/ac/ConditionManagement.java b/src/main/java/de/ids_mannheim/korap/security/ac/ConditionManagement.java
index d0db4fa..bda8260 100644
--- a/src/main/java/de/ids_mannheim/korap/security/ac/ConditionManagement.java
+++ b/src/main/java/de/ids_mannheim/korap/security/ac/ConditionManagement.java
@@ -1,6 +1,6 @@
 package de.ids_mannheim.korap.security.ac;
 
-import de.ids_mannheim.korap.config.BeanConfiguration;
+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;
@@ -28,7 +28,8 @@
 
     public ConditionManagement (User user) {
         this.user = user;
-        this.policydao = BeanConfiguration.getBeans().getPolicyDbProvider();
+        this.policydao = BeansFactory.getKustvaktContext()
+                .getPolicyDbProvider();
 
     }
 
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 059d33b..0fc0863 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
@@ -58,13 +58,11 @@
         this.policies[0] = new ArrayList<>();
         this.silent = true;
         this.user = user;
-        overrideProviders(null);
+        overrideProviders(BeansFactory.getKustvaktContext());
     }
 
 
     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();
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 918650a..8decf1d 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
@@ -761,7 +761,7 @@
             return data;
         }
         catch (KustvaktException e) {
-            jlog.error("Error during user data retrieval!", e.getEntity());
+            jlog.error("Error during user data retrieval: {}", e.getEntity());
             throw new WrappedException(e, StatusCodes.GET_ACCOUNT_FAILED);
         }
     }
diff --git a/src/main/java/de/ids_mannheim/korap/utils/KoralCollectionQueryBuilder.java b/src/main/java/de/ids_mannheim/korap/utils/KoralCollectionQueryBuilder.java
index a559415..811c227 100644
--- a/src/main/java/de/ids_mannheim/korap/utils/KoralCollectionQueryBuilder.java
+++ b/src/main/java/de/ids_mannheim/korap/utils/KoralCollectionQueryBuilder.java
@@ -191,8 +191,6 @@
 
 
         public static ObjectNode buildDocGroup (String op, JsonNode ... groups) {
-            System.out.println("GROUPS " + Arrays.asList(groups));
-
             ObjectNode node = JsonUtils.createObjectNode();
             node.put("@type", "koral:docGroup");
             node.put("operation", "operation:" + op);
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 8dd27e3..48d5030 100644
--- a/src/main/java/de/ids_mannheim/korap/web/KustvaktBaseServer.java
+++ b/src/main/java/de/ids_mannheim/korap/web/KustvaktBaseServer.java
@@ -31,8 +31,7 @@
         KustvaktConfiguration.loadLog4jLogger();
         KustvaktBaseServer server = new KustvaktBaseServer() {
             @Override
-            protected void setup() {
-            }
+            protected void setup () {}
         };
         KustvaktArgs kargs = server.readAttributes(args);
 
@@ -78,7 +77,9 @@
         return kargs;
     }
 
-    protected abstract void setup();
+
+    protected abstract void setup ();
+
 
     protected void startServer (KustvaktArgs kargs) {
         if (kargs.init)
@@ -125,7 +126,7 @@
             server.join();
         }
         catch (Exception e) {
-            e.printStackTrace();
+            System.out.println("Server could not be started!");
             System.exit(-1);
         }
 
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 6d2e309..6f4afe0 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
@@ -245,7 +245,7 @@
             controller.logout(context);
         }
         catch (KustvaktException e) {
-            jlog.error("Logout Exception", e);
+            jlog.error("Logout Exception: {}", e.string());
             throw KustvaktResponseHandler.throwit(e);
         }
         return Response.ok().build();
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 c77d409..2bced4f 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
@@ -379,7 +379,7 @@
         }
         catch (KustvaktException e) {
             //todo: instead of throwing exception, build notification and rewrites into result query
-            jlog.error("Exception encountered!");
+            jlog.error("Exception encountered: {}", e.string());
             throw KustvaktResponseHandler.throwit(e);
         }
 
@@ -440,7 +440,7 @@
             user = controller.getUser(context.getUsername());
         }
         catch (KustvaktException e) {
-            jlog.error("Exception encountered!", e);
+            jlog.error("Exception encountered: {}", e.string());
             throw KustvaktResponseHandler.throwit(e);
         }
         String result;
@@ -483,6 +483,7 @@
                 result = this.graphDBhandler.getResponse(map, "distKwic");
             }
             catch (KustvaktException e) {
+                jlog.error("Exception encountered: {}", e.string());
                 throw KustvaktResponseHandler.throwit(e);
             }
         }
@@ -582,8 +583,8 @@
                     MultivaluedMap map = new MultivaluedMapImpl();
                     map.add("q", query);
                     map.add("count", String.valueOf(pageLength));
-                    map.add("lctxs", String.valueOf(meta.getSpanContext()
-                            .getLeftSize()));
+                    map.add("lctxs",
+                            String.valueOf(meta.getSpanContext().getLeftSize()));
                     map.add("rctxs", String.valueOf(meta.getSpanContext()
                             .getRightSize()));
                     result = this.graphDBhandler.getResponse(map, "distKwic");
@@ -602,7 +603,7 @@
             return Response.ok(result).build();
         }
         catch (KustvaktException e) {
-            jlog.error("Exception encountered!", e);
+            jlog.error("Exception encountered: {}", e.string());
             throw KustvaktResponseHandler.throwit(e);
         }
 
@@ -671,6 +672,7 @@
             return Response.ok(searchKrill.getStatistics(qstr)).build();
         }
         catch (KustvaktException e) {
+            jlog.error("Exception encountered: {}", e.string());
             throw KustvaktResponseHandler.throwit(e);
         }
     }
@@ -694,6 +696,7 @@
             user = controller.getUser(c.getUsername());
         }
         catch (KustvaktException e) {
+            jlog.error("Exception encountered: {}", e.string());
             throw KustvaktResponseHandler.throwit(e);
         }
 
@@ -748,7 +751,7 @@
             this.resourceHandler.updateResources(user, resource);
         }
         catch (KustvaktException e) {
-            jlog.error("Exception encountered!", e);
+            jlog.error("Exception encountered: {}", e.string());
             throw KustvaktResponseHandler.throwit(e);
         }
         return Response.ok().build();
@@ -777,7 +780,7 @@
             user = controller.getUser(ctx.getUsername());
         }
         catch (KustvaktException e) {
-            jlog.error("Exception encountered!", e);
+            jlog.error("Exception encountered: {}", e.string());
             throw KustvaktResponseHandler.throwit(e);
         }
         if (VirtualCollection.class.equals(ResourceFactory
@@ -823,7 +826,7 @@
                     resourceHandler.storeResources(user, collection);
                 }
                 catch (KustvaktException e) {
-                    jlog.error("Exception encountered!", e);
+                    jlog.error("Exception encountered: {}", e.string());
                     throw KustvaktResponseHandler.throwit(e);
                 }
             }
@@ -866,7 +869,7 @@
             user = controller.getUser(ctx.getUsername());
         }
         catch (KustvaktException e) {
-            jlog.error("Exception encountered!", e);
+            jlog.error("Exception encountered: {}", e.string());
             throw KustvaktResponseHandler.throwit(e);
         }
         if (VirtualCollection.class.equals(ResourceFactory
@@ -908,7 +911,7 @@
                     resourceHandler.storeResources(user, collection);
                 }
                 catch (KustvaktException e) {
-                    jlog.error("Exception encountered!", e);
+                    jlog.error("Exception encountered: {}", e.string());
                     throw KustvaktResponseHandler.throwit(e);
                 }
             }
@@ -947,7 +950,7 @@
             resourceHandler.deleteResources(user, r);
         }
         catch (KustvaktException e) {
-            jlog.error("Exception encountered!", e);
+            jlog.error("Exception encountered: {}", e.string());
             throw KustvaktResponseHandler.throwit(e);
         }
 
@@ -978,7 +981,7 @@
             user = controller.getUser(tokenContext.getUsername());
         }
         catch (KustvaktException e) {
-            jlog.error("Exception encountered!", e);
+            jlog.error("Exception encountered: {}", e.string());
             throw KustvaktResponseHandler.throwit(e);
         }
 
@@ -1026,7 +1029,7 @@
                 resources = ResourceFinder.search(user, Layer.class);
             }
             catch (KustvaktException e) {
-                jlog.error("Exception encountered!", e);
+                jlog.error("Exception encountered: {}", e.string());
                 throw KustvaktResponseHandler.throwit(e);
             }
             // returns foundries and layers.
@@ -1104,6 +1107,7 @@
                     this.controller.getUser(ctx.getUsername()), id);
         }
         catch (KustvaktException e) {
+            jlog.error("Exception encountered: {}", e.string());
             throw KustvaktResponseHandler.throwit(e);
         }
 
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 5aa25c9..a0b2846 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
@@ -311,7 +311,7 @@
             result = data.data();
         }
         catch (KustvaktException e) {
-            jlog.error("Exception encountered!", e);
+            jlog.error("Exception encountered: {}", e.string());
             throw KustvaktResponseHandler.throwit(e);
         }
         return Response.ok(result).build();
diff --git a/src/test/java/de/ids_mannheim/korap/config/TestHelper.java b/src/test/java/de/ids_mannheim/korap/config/TestHelper.java
index 521a049..53404b6 100644
--- a/src/test/java/de/ids_mannheim/korap/config/TestHelper.java
+++ b/src/test/java/de/ids_mannheim/korap/config/TestHelper.java
@@ -1,5 +1,6 @@
 package de.ids_mannheim.korap.config;
 
+import de.ids_mannheim.korap.exceptions.EmptyResultException;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.handlers.*;
 import de.ids_mannheim.korap.interfaces.AuthenticationIface;
@@ -35,8 +36,7 @@
 import java.sql.SQLException;
 import java.util.*;
 
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.*;
 
 /**
  * creates a test user that can be used to access protected functions
@@ -118,34 +118,42 @@
 
     public TestHelper setupSimpleAccount (String username, String password) {
         KustvaktBaseDaoInterface dao = getBean(ContextHolder.KUSTVAKT_USERDB);
+        EntityHandlerIface edao = (EntityHandlerIface) dao;
+        try {
+            edao.getAccount(username);
+        }
+        catch (EmptyResultException e) {
+            // do nothing
+        }
+        catch (KustvaktException ex) {
+            assertNull("Test user could not be set up", true);
+        }
 
-        if (dao.size() == 0) {
-            Map m = new HashMap<>();
-            m.put(Attributes.USERNAME, username);
+        Map m = new HashMap<>();
+        m.put(Attributes.USERNAME, username);
 
-            try {
-                String hash = ((EncryptionIface) getBean(ContextHolder.KUSTVAKT_ENCRYPTION))
-                        .secureHash(password);
-                m.put(Attributes.PASSWORD, hash);
-            }
-            catch (NoSuchAlgorithmException | UnsupportedEncodingException
-                    | KustvaktException e) {
-                // do nohting
-                assertNotNull("Exception thrown", null);
-            }
-            assertNotNull("userdatabase handler must not be null", dao);
+        try {
+            String hash = ((EncryptionIface) getBean(ContextHolder.KUSTVAKT_ENCRYPTION))
+                    .secureHash(password);
+            m.put(Attributes.PASSWORD, hash);
+        }
+        catch (NoSuchAlgorithmException | UnsupportedEncodingException
+                | KustvaktException e) {
+            // do nohting
+            assertNotNull("Exception thrown", null);
+        }
+        assertNotNull("userdatabase handler must not be null", dao);
 
-            try {
-                EntityHandlerIface edao = (EntityHandlerIface) dao;
-                int i = edao.createAccount(User.UserFactory.toKorAPUser(m));
-                assert BeansFactory.getKustvaktContext().getUserDBHandler()
-                        .getAccount(credentials[0]) != null;
-                assert i == 1;
-            }
-            catch (KustvaktException e) {
-                // do nothing
-                Assert.assertNull("Test user could not be set up", true);
-            }
+        try {
+
+            int i = edao.createAccount(User.UserFactory.toKorAPUser(m));
+            assert BeansFactory.getKustvaktContext().getUserDBHandler()
+                    .getAccount(credentials[0]) != null;
+            assertEquals(1, i);
+        }
+        catch (KustvaktException e) {
+            // do nothing
+            assertNull("Test user could not be set up", true);
         }
         return this;
     }
diff --git a/src/test/java/de/ids_mannheim/korap/web/service/FastJerseyTest.java b/src/test/java/de/ids_mannheim/korap/web/service/FastJerseyTest.java
index b65a73f..3d36b6f 100644
--- a/src/test/java/de/ids_mannheim/korap/web/service/FastJerseyTest.java
+++ b/src/test/java/de/ids_mannheim/korap/web/service/FastJerseyTest.java
@@ -122,7 +122,7 @@
                 testContainer.start();
             }
         }
-        catch (TestContainerException e) {
+        catch (Exception e) {
             initServer(PORT + PORT_IT++);
             startServer();
         }
diff --git a/src/test/java/de/ids_mannheim/korap/web/service/full/AuthServiceTest.java b/src/test/java/de/ids_mannheim/korap/web/service/full/AuthServiceTest.java
index 47771b1..b41ecd3 100644
--- a/src/test/java/de/ids_mannheim/korap/web/service/full/AuthServiceTest.java
+++ b/src/test/java/de/ids_mannheim/korap/web/service/full/AuthServiceTest.java
@@ -31,6 +31,7 @@
     public void testBasicHttp () {
         User user = helper().getUser();
 
+
     }
 
 
