diff --git a/full/Changes b/full/Changes
index 2135576..7648ee3 100644
--- a/full/Changes
+++ b/full/Changes
@@ -1,7 +1,7 @@
 # version 0.71
 
-- Removed auditing (closes #611)
-
+- Removed auditing (#611)
+- Removed old database configurations (#612)
 
 # version 0.70.1
 
diff --git a/full/src/main/java/de/ids_mannheim/korap/authentication/AuthenticationManager.java b/full/src/main/java/de/ids_mannheim/korap/authentication/AuthenticationManager.java
index 2fcc4e9..5b4f9c8 100644
--- a/full/src/main/java/de/ids_mannheim/korap/authentication/AuthenticationManager.java
+++ b/full/src/main/java/de/ids_mannheim/korap/authentication/AuthenticationManager.java
@@ -12,7 +12,6 @@
 import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.security.context.TokenContext;
 import de.ids_mannheim.korap.user.User;
-import de.ids_mannheim.korap.user.Userdata;
 
 /**
  * @author hanl
@@ -61,8 +60,6 @@
 
     public abstract User getUser (String username) throws KustvaktException;
 
-    public abstract boolean isRegistered (String id);
-
     public abstract User authenticate (AuthenticationMethod method,
             String username, String password, Map<String, Object> attributes)
             throws KustvaktException;
@@ -72,20 +69,6 @@
 
     public abstract void setAccessAndLocation (User user, HttpHeaders headers);
 
-    public abstract void logout (TokenContext context) throws KustvaktException;
-
-    public abstract void lockAccount (User user) throws KustvaktException;
-
-    public abstract boolean deleteAccount (User user) throws KustvaktException;
-
-    @Deprecated
-    public abstract <T extends Userdata> T getUserData (User user,
-            Class<T> clazz) throws KustvaktException;
-
-    @Deprecated
-    public abstract void updateUserData (Userdata data)
-            throws KustvaktException;
-
     public String providerList () {
         return "provider list: " + this.providers.toString();
     }
diff --git a/full/src/main/java/de/ids_mannheim/korap/authentication/DummyAuthenticationManager.java b/full/src/main/java/de/ids_mannheim/korap/authentication/DummyAuthenticationManager.java
index cd8f02c..306bf95 100644
--- a/full/src/main/java/de/ids_mannheim/korap/authentication/DummyAuthenticationManager.java
+++ b/full/src/main/java/de/ids_mannheim/korap/authentication/DummyAuthenticationManager.java
@@ -13,7 +13,6 @@
 import de.ids_mannheim.korap.security.context.TokenContext;
 import de.ids_mannheim.korap.user.KorAPUser;
 import de.ids_mannheim.korap.user.User;
-import de.ids_mannheim.korap.user.Userdata;
 import de.ids_mannheim.korap.utils.TimeUtils;
 
 public class DummyAuthenticationManager extends AuthenticationManager {
@@ -45,12 +44,6 @@
     }
 
     @Override
-    public boolean isRegistered (String id) {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    @Override
     public User authenticate (AuthenticationMethod method, String username,
             String password, Map<String, Object> attributes)
             throws KustvaktException {
@@ -72,37 +65,6 @@
     }
 
     @Override
-    public void logout (TokenContext context) throws KustvaktException {
-        // TODO Auto-generated method stub
-
-    }
-
-    @Override
-    public void lockAccount (User user) throws KustvaktException {
-        // TODO Auto-generated method stub
-
-    }
-
-    @Override
-    public boolean deleteAccount (User user) throws KustvaktException {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    @Override
-    public <T extends Userdata> T getUserData (User user, Class<T> clazz)
-            throws KustvaktException {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    @Override
-    public void updateUserData (Userdata data) throws KustvaktException {
-        // TODO Auto-generated method stub
-
-    }
-
-    @Override
     public User getUser (String username, String method)
             throws KustvaktException {
         // TODO Auto-generated method stub
diff --git a/full/src/main/java/de/ids_mannheim/korap/authentication/KustvaktAuthenticationManager.java b/full/src/main/java/de/ids_mannheim/korap/authentication/KustvaktAuthenticationManager.java
index af55b3e..1a55905 100644
--- a/full/src/main/java/de/ids_mannheim/korap/authentication/KustvaktAuthenticationManager.java
+++ b/full/src/main/java/de/ids_mannheim/korap/authentication/KustvaktAuthenticationManager.java
@@ -3,7 +3,6 @@
 import java.net.InetAddress;
 import java.net.UnknownHostException;
 import java.util.Arrays;
-import java.util.Collection;
 import java.util.Map;
 
 import javax.ws.rs.core.HttpHeaders;
@@ -14,25 +13,21 @@
 import org.eclipse.jetty.http.HttpHeader;
 import org.springframework.beans.factory.annotation.Autowired;
 
-import com.mchange.rmi.NotAuthorizedException;
 // import com.novell.ldap.*; search() funktioniert nicht korrekt, ausgewechselt gegen unboundID's Bibliothek 20.04.17/FB
 //Using JAR from unboundID:
 import com.unboundid.ldap.sdk.LDAPException;
 
 import de.ids_mannheim.korap.config.Attributes;
-import de.ids_mannheim.korap.config.BeansFactory;
 import de.ids_mannheim.korap.config.FullConfiguration;
 import de.ids_mannheim.korap.config.URIParam;
 import de.ids_mannheim.korap.constant.AuthenticationMethod;
 import de.ids_mannheim.korap.constant.TokenType;
-import de.ids_mannheim.korap.dao.AdminDao;
 import de.ids_mannheim.korap.exceptions.EmptyResultException;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.exceptions.StatusCodes;
 import de.ids_mannheim.korap.exceptions.WrappedException;
 import de.ids_mannheim.korap.interfaces.EncryptionIface;
 import de.ids_mannheim.korap.interfaces.EntityHandlerIface;
-import de.ids_mannheim.korap.interfaces.db.UserDataDbIface;
 import de.ids_mannheim.korap.security.context.TokenContext;
 import de.ids_mannheim.korap.user.DemoUser;
 import de.ids_mannheim.korap.user.KorAPUser;
@@ -40,9 +35,6 @@
 import de.ids_mannheim.korap.user.User;
 import de.ids_mannheim.korap.user.User.CorpusAccess;
 import de.ids_mannheim.korap.user.User.Location;
-import de.ids_mannheim.korap.user.UserDetails;
-import de.ids_mannheim.korap.user.UserSettingProcessor;
-import de.ids_mannheim.korap.user.Userdata;
 import de.ids_mannheim.korap.utils.TimeUtils;
 import de.ids_mannheim.korap.validator.Validator;
 
@@ -61,22 +53,15 @@
 	private EncryptionIface crypto;
 	private EntityHandlerIface entHandler;
 	@Autowired
-	private AdminDao adminDao;
 	private FullConfiguration config;
-	@Deprecated
-	private Collection userdatadaos;
-	private LoginCounter counter;
 	@Autowired
 	private Validator validator;
 	
-	public KustvaktAuthenticationManager(EntityHandlerIface userdb, EncryptionIface crypto,
-			FullConfiguration config, Collection<UserDataDbIface> userdatadaos) {
+	public KustvaktAuthenticationManager(EncryptionIface crypto,
+			FullConfiguration config) {
 	    super("id_tokens");
-		this.entHandler = userdb;
 		this.config = config;
 		this.crypto = crypto;
-		this.counter = new LoginCounter(config);
-		this.userdatadaos = userdatadaos;
 		// todo: load via beancontext
 //		try {
 //			this.validator = new ApacheValidator();
@@ -300,16 +285,6 @@
 		return context;
 	}
 
-	// todo: test
-	@Deprecated
-	private boolean matchStatus(String host, String useragent, TokenContext context) {
-		if (host.equals(context.getHostAddress())) {
-			if (useragent.equals(context.getUserAgent()))
-				return true;
-		}
-		return false;
-	}
-
 	@Deprecated
 	private User authenticateShib(Map<String, Object> attributes) throws KustvaktException {
 		// todo use persistent id, since eppn is not unique
@@ -322,8 +297,6 @@
 			attributes.put(Attributes.EMAIL, eppn);
 
 		User user = null;
-		if (isRegistered(eppn))
-			user = createShibbUserAccount(attributes);
 		return user;
 	}
 
@@ -357,7 +330,6 @@
 			}
 		}
 
-		boolean isAdmin = adminDao.isAdmin(unknown.getUsername());
         if (DEBUG) {
             jlog.debug(
                     "Authentication: found username " + unknown.getUsername());
@@ -373,7 +345,6 @@
 			if (!check) {
 				// the fail counter only applies for wrong password
 				jlog.warn("Wrong Password!");
-				processLoginFail(unknown);
 				throw new WrappedException(new KustvaktException(user.getId(), StatusCodes.BAD_CREDENTIALS),
 						StatusCodes.LOGIN_FAILED, username);
 			}
@@ -391,7 +362,6 @@
                     }
 					if (TimeUtils.getNow().isAfter(param.getUriExpiration())) {
 						jlog.error("URI token is expired. Deleting account for user "+ user.getUsername());
-						deleteAccount(user);
 						throw new WrappedException(
 								new KustvaktException(unknown.getId(), StatusCodes.EXPIRED,
 										"account confirmation uri has expired!", param.getUriFragment()),
@@ -429,7 +399,6 @@
 
 	private User authenticateIdM(String username, String password, Map<String, Object> attr) throws KustvaktException {
 
-		Map<String, Object> attributes = validator.validateMap(attr);
 		User unknown = null;
 		// just to make sure that the plain password does not appear anywhere in
 		// the logs!
@@ -543,9 +512,10 @@
 			 * username); }
 			 */
 
-		} else if (unknown instanceof ShibbolethUser) {
-			// todo
-		}
+		} 
+//		else if (unknown instanceof ShibbolethUser) {
+//			// todo
+//		}
 
         if (DEBUG) {
             jlog.debug("Authentication done: " + username);
@@ -554,224 +524,4 @@
 
 	} // authenticateIdM
 
-	@Deprecated
-	public boolean isRegistered(String username) {
-		User user;
-		if (username == null || username.isEmpty())
-			return false;
-		// throw new KustvaktException(username, StatusCodes.ILLEGAL_ARGUMENT,
-		// "username must be set", username);
-
-		try {
-			user = entHandler.getAccount(username);
-		} catch (EmptyResultException e) {
-			jlog.debug("user does not exist: "+ username);
-			return false;
-
-		} catch (KustvaktException e) {
-			jlog.error("KorAPException "+ e.string());
-			return false;
-			// throw new KustvaktException(username,
-			// StatusCodes.ILLEGAL_ARGUMENT,
-			// "username invalid", username);
-		}
-		return user != null;
-	}
-
-	@Deprecated
-	public void logout(TokenContext context) throws KustvaktException {
-		try {
-			AuthenticationIface provider = getProvider(context.getTokenType(), null);
-
-			if (provider == null) {
-				throw new KustvaktException(StatusCodes.ILLEGAL_ARGUMENT, "Authentication "
-				        + "provider not supported!", context.getTokenType().displayName());
-			}
-			provider.removeUserSession(context.getToken());
-		} catch (KustvaktException e) {
-			throw new WrappedException(e, StatusCodes.LOGOUT_FAILED, context.toString());
-		}
-		this.removeCacheEntry(context.getToken());
-	}
-
-	@Deprecated
-	private void processLoginFail(User user) throws KustvaktException {
-		counter.registerFail(user.getUsername());
-		if (!counter.validate(user.getUsername())) {
-			try {
-				this.lockAccount(user);
-			} catch (KustvaktException e) {
-				jlog.error("user account could not be locked", e);
-				throw new WrappedException(e, StatusCodes.UPDATE_ACCOUNT_FAILED);
-			}
-			throw new WrappedException(new KustvaktException(user.getId(), StatusCodes.ACCOUNT_DEACTIVATED),
-					StatusCodes.LOGIN_FAILED);
-		}
-	}
-
-	@Deprecated
-	public void lockAccount(User user) throws KustvaktException {
-		if (!(user instanceof KorAPUser))
-			throw new KustvaktException(StatusCodes.REQUEST_INVALID);
-
-		KorAPUser u = (KorAPUser) user;
-		u.setAccountLocked(true);
-		jlog.info("locking account for user: "+ user.getUsername());
-		entHandler.updateAccount(u);
-	}
-
-	@Deprecated	// todo:
-	private ShibbolethUser createShibbUserAccount(Map<String, Object> attributes) throws KustvaktException {
-        if (DEBUG) {
-            jlog.debug("creating shibboleth user account for user attr: "
-                    + attributes);
-        }
-		Map<String, Object> safeMap = validator.validateMap(attributes);
-
-		// todo eppn non-unique.join with idp or use persistent_id as username
-		// identifier
-		// EM: disabled
-//		ShibbolethUser user = User.UserFactory.getShibInstance((String) safeMap.get(Attributes.EPPN),
-//				(String) safeMap.get(Attributes.MAIL), (String) safeMap.get(Attributes.CN));
-//		user.setAffiliation((String) safeMap.get(Attributes.EDU_AFFIL));
-//		user.setAccountCreation(TimeUtils.getNow().getMillis());
-
-		ShibbolethUser user = null;
-		
-		UserDetails d = new UserDetails();
-		d.read(attributes, true);
-
-		UserSettingProcessor s = new UserSettingProcessor();
-		s.read(attributes, true);
-
-		entHandler.createAccount(user);
-
-//		s.setUserId(user.getId());
-//		d.setUserId(user.getId());
-
-		UserDataDbIface dao = BeansFactory.getTypeFactory().getTypeInterfaceBean(userdatadaos, UserDetails.class);
-		assert dao != null;
-		dao.store(d);
-
-		dao = BeansFactory.getTypeFactory().getTypeInterfaceBean(userdatadaos, UserSettingProcessor.class);
-		assert dao != null;
-		dao.store(d);
-
-		return user;
-	}
-
-	/**
-	 * link shibboleth and korap user account to one another.
-	 * 
-	 * @param current
-	 *            currently logged in user
-	 * @param for_name
-	 *            foreign user name the current account should be linked to
-	 * @param transstrat
-	 *            transfer status of user data (details, settings, user queries)
-	 *            0 = the currently logged in data should be kept 1 = the
-	 *            foreign account data should be kept
-	 * @throws NotAuthorizedException
-	 * @throws KustvaktException
-	 */
-	// todo:
-	@Deprecated
-	public void accountLink(User current, String for_name, int transstrat) throws KustvaktException {
-		// User foreign = entHandler.getAccount(for_name);
-
-		// if (current.getAccountLink() == null && current.getAccountLink()
-		// .isEmpty()) {
-		// if (current instanceof KorAPUser && foreign instanceof ShibUser) {
-		// if (transstrat == 1)
-		// current.transfer(foreign);
-		//// foreign.setAccountLink(current.getUsername());
-		//// current.setAccountLink(foreign.getUsername());
-		// // entHandler.purgeDetails(foreign);
-		// // entHandler.purgeSettings(foreign);
-		// }else if (foreign instanceof KorAPUser
-		// && current instanceof ShibUser) {
-		// if (transstrat == 0)
-		// foreign.transfer(current);
-		//// current.setAccountLink(foreign.getUsername());
-		// // entHandler.purgeDetails(current);
-		// // entHandler.purgeSettings(current);
-		// // entHandler.purgeSettings(current);
-		// }
-		// entHandler.updateAccount(current);
-		// entHandler.updateAccount(foreign);
-		// }
-	}
-
-	@Deprecated
-	// todo: test and rest usage?!
-	public boolean updateAccount(User user) throws KustvaktException {
-		boolean result;
-		if (user instanceof DemoUser)
-			throw new KustvaktException(user.getId(), StatusCodes.REQUEST_INVALID,
-					"account not updateable for demo user", user.getUsername());
-		else {
-			// crypto.validate(user);
-			try {
-				result = entHandler.updateAccount(user) > 0;
-			} catch (KustvaktException e) {
-				jlog.error("Error: "+ e.string());
-				throw new WrappedException(e, StatusCodes.UPDATE_ACCOUNT_FAILED);
-			}
-		}
-		return result;
-	}
-
-	@Deprecated
-	public boolean deleteAccount(User user) throws KustvaktException {
-		boolean result;
-		if (user instanceof DemoUser)
-			return true;
-		else {
-			try {
-				result = entHandler.deleteAccount(user.getId()) > 0;
-			} catch (KustvaktException e) {
-				jlog.error("Error: "+ e.string());
-				throw new WrappedException(e, StatusCodes.DELETE_ACCOUNT_FAILED);
-			}
-		}
-		return result;
-	}
-
-	// EM: not in the new DB
-	@Deprecated
-	@Override
-	public <T extends Userdata> T getUserData(User user, Class<T> clazz) throws WrappedException {
-		try {
-			UserDataDbIface<T> dao = BeansFactory.getTypeFactory()
-					.getTypeInterfaceBean(BeansFactory.getKustvaktContext().getUserDataProviders(), clazz);
-			T data = null;
-			if (dao != null)
-				data = dao.get(user);
-
-			if (data == null)
-				throw new KustvaktException(user.getId(), StatusCodes.NO_RESULT_FOUND, "No data found!",
-						clazz.getSimpleName());
-			return data;
-		} catch (KustvaktException e) {
-			jlog.error("Error during user data retrieval: "+ e.getEntity());
-			throw new WrappedException(e, StatusCodes.GET_ACCOUNT_FAILED);
-		}
-	}
-
-	@Deprecated
-	// todo: cache userdata outside of the user object!
-	@Override
-	public void updateUserData(Userdata data) throws WrappedException {
-		try {
-			data.validate(this.validator);
-			UserDataDbIface dao = BeansFactory.getTypeFactory()
-					.getTypeInterfaceBean(BeansFactory.getKustvaktContext().getUserDataProviders(), data.getClass());
-			if (dao != null)
-				dao.update(data);
-		} catch (KustvaktException e) {
-			jlog.error("Error during update of user data! "+ e.getEntity());
-			throw new WrappedException(e, StatusCodes.UPDATE_ACCOUNT_FAILED);
-		}
-	}
-
 }
diff --git a/full/src/main/java/de/ids_mannheim/korap/config/ContextHolder.java b/full/src/main/java/de/ids_mannheim/korap/config/ContextHolder.java
index f2e22ab..7626ec1 100644
--- a/full/src/main/java/de/ids_mannheim/korap/config/ContextHolder.java
+++ b/full/src/main/java/de/ids_mannheim/korap/config/ContextHolder.java
@@ -1,12 +1,8 @@
 package de.ids_mannheim.korap.config;
 
-import java.util.Collection;
-
 import org.springframework.beans.factory.NoSuchBeanDefinitionException;
 import org.springframework.context.ApplicationContext;
 
-import de.ids_mannheim.korap.interfaces.db.PersistenceClient;
-import de.ids_mannheim.korap.interfaces.db.UserDataDbIface;
 import de.ids_mannheim.korap.web.CoreResponseHandler;
 
 /**
@@ -74,17 +70,6 @@
         return (T) getBean(KUSTVAKT_CONFIG);
     }
 
-
-    @Deprecated
-    public PersistenceClient getPersistenceClient () {
-        return getBean(KUSTVAKT_DB);
-    }
-
-    @Deprecated
-    public Collection<UserDataDbIface> getUserDataProviders () {
-        return getBean(KUSTVAKT_USERDATA);
-    }
-
     private void close () {
         this.context = null;
     }
diff --git a/full/src/main/java/de/ids_mannheim/korap/handlers/EntityDao.java b/full/src/main/java/de/ids_mannheim/korap/handlers/EntityDao.java
deleted file mode 100644
index ffc35e5..0000000
--- a/full/src/main/java/de/ids_mannheim/korap/handlers/EntityDao.java
+++ /dev/null
@@ -1,393 +0,0 @@
-package de.ids_mannheim.korap.handlers;
-
-import java.sql.Date;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
-import org.springframework.dao.DataAccessException;
-import org.springframework.dao.DuplicateKeyException;
-import org.springframework.dao.EmptyResultDataAccessException;
-import org.springframework.jdbc.core.namedparam.MapSqlParameterSource;
-import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
-import org.springframework.jdbc.support.GeneratedKeyHolder;
-import org.springframework.jdbc.support.KeyHolder;
-
-import de.ids_mannheim.korap.config.ParamFields;
-import de.ids_mannheim.korap.config.URIParam;
-import de.ids_mannheim.korap.exceptions.DatabaseException;
-import de.ids_mannheim.korap.exceptions.KustvaktException;
-import de.ids_mannheim.korap.exceptions.StatusCodes;
-import de.ids_mannheim.korap.interfaces.EntityHandlerIface;
-import de.ids_mannheim.korap.interfaces.KustvaktBaseDaoInterface;
-import de.ids_mannheim.korap.interfaces.db.PersistenceClient;
-import de.ids_mannheim.korap.user.KorAPUser;
-import de.ids_mannheim.korap.user.ShibbolethUser;
-import de.ids_mannheim.korap.user.User;
-import de.ids_mannheim.korap.utils.BooleanUtils;
-import de.ids_mannheim.korap.utils.TimeUtils;
-
-/* WKP: In computer software, a data access object (DAO) is an object that provides an abstract interface to some type 
- * of database or other persistence mechanism. By mapping application calls to the persistence layer, the DAO provides 
- * some specific data operations without exposing details of the database. 
- */
-@Deprecated
-/**
- * @author hanl
- * @date 13/01/2014
- */
-public class EntityDao implements EntityHandlerIface, KustvaktBaseDaoInterface {
-
-    private static Logger jlog = LogManager.getLogger(EntityDao.class);
-    private NamedParameterJdbcTemplate jdbcTemplate;
-
-
-    public EntityDao (PersistenceClient client) {
-        this.jdbcTemplate = (NamedParameterJdbcTemplate) client.getSource();
-    }
-
-    // usersettings are fetched plus basic account info, no details, since i rarely use them anyway! (by Hanl)
-    /* Version mit LDAP Authentication - 09.05.17/FB
-     * getAccount(): KorAPUser:  Account muss vorhanden sein.
-     *               DemoUser, DefaultUser: Account nicht vorhanden.
-     */
-    @Override
-    public User getAccount (String username) throws KustvaktException {
-    	
-    	Map<String, String> namedParameters = Collections.singletonMap("username", username);
-        final String sql = "select a.* from korap_users as a where a.username=:username;";
-        User user = null;
-        
-        try {
-            user = this.jdbcTemplate.queryForObject(sql, namedParameters,
-                    new RowMapperFactory.UserMapper());
-            return user;
-        	}
-        catch (EmptyResultDataAccessException ae) {
-            jlog.warn("No user found for name "+ username);
-        	}
-        catch (DataAccessException e) {
-            jlog.warn("Could not retrieve user for name: " + username, e);
-            
-            /* DemoUser and DefaultUser have no account,
-             * so it's ok they are not found.
-            throw new DatabaseException(username, "korap_users",
-                    StatusCodes.DB_GET_FAILED,
-                    "Could not retrieve the user with username: " + username,
-                    username);
-             */
-            }
-
-        // DemoUser or DefaultUser?
-        
-        {	// User cannot be found in SQL DB since LDAP Authentication,
-        	// so create a User Object here.
-        	// TODO: what more data should be stored into it?
-        	// 28.04.17/FB
-        	user = new KorAPUser(); // oder eigentlich new DemoUser oder new DefaultUser.
-        	user.setUsername(username);
-        	return user;
-        }
-        
-        
-    } // getAccount()
-
-    // usersettings are fetched plus basic account info, no details, since i rarely use them anyway! (by Hanl)
-    /* Version before LDAP Authentication - 09.05.17/FB
-    @Deprecated
-    @Override
-    public User getAccount (String username) throws KustvaktException {
-    	
-    	Boolean bDEBUG = true;
-        Map<String, String> namedParameters = Collections
-                .singletonMap("username", username);
-        final String sql = "select a.* from korap_users as a where a.username=:username;";
-        User user;
-       
-        try {
-            user = this.jdbcTemplate.queryForObject(sql, namedParameters,
-                    new RowMapperFactory.UserMapper());
-        }
-        catch (EmptyResultDataAccessException ae) {
-            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);
-            throw new DatabaseException(username, "korap_users",
-                    StatusCodes.DB_GET_FAILED,
-                    "Could not retrieve the user with username: " + username,
-                    username);
-        }
-        return user;
-    }
-	*/
-
-    @Override
-    public int updateAccount (User user) throws KustvaktException {
-        MapSqlParameterSource np = new MapSqlParameterSource();
-        final String query;
-        if (user instanceof KorAPUser) {
-            KorAPUser k = (KorAPUser) user;
-            np.addValue("ali", k.getAccountLink());
-            np.addValue("alo", k.isAccountLocked());
-            if (k.getPassword() != null)
-                np.addValue("ps", k.getPassword());
-            //            URIParam param = k.getField(URIParam.class);
-            //            if (param != null) {
-            //                np.addValue("frag", param.getUriFragment());
-            //                np.addValue("exp", new Date(param.getUriExpiration()));
-            //            }else {
-            //                np.addValue("frag", null);
-            //                np.addValue("exp", null);
-            //            }
-            np.addValue("id", k.getId());
-
-            query = "UPDATE korap_users SET account_lock=:alo,"
-                    + "account_link=:ali, password=:ps "
-                    //                    "uri_fragment=:frag," +
-                    //                    "uri_expiration=:exp "
-                    + "WHERE id=:id";
-        }
-        else if (user instanceof ShibbolethUser) {
-            ShibbolethUser s = (ShibbolethUser) user;
-            //todo:
-            //            np.addValue("ali", s.getAccountLink());
-            np.addValue("ali", null);
-            np.addValue("edu", s.getAffiliation());
-            np.addValue("id", s.getId());
-            np.addValue("cn", s.getCommonName());
-            np.addValue("mail", s.getMail());
-
-            query = "UPDATE shibusers SET account_link=:ali"
-                    + " eduPersonScopedAffiliation=:edu"
-                    + "mail=:mail, cn=:cn WHERE id=:id";
-        }
-        else
-            return -1;
-        try {
-            return this.jdbcTemplate.update(query, np);
-        }
-        catch (DataAccessException e) {
-            jlog.error(
-                    "Could not update user account for user: " + user.getId(),
-                    e);
-            throw new DatabaseException(user.getId(), "korap_users",
-                    StatusCodes.DB_UPDATE_FAILED,
-                    "Could not update user account for user: " + user.getId(),
-                    user.toString());
-        }
-    }
-
-
-    @Override
-    public int createAccount (User user) throws KustvaktException {
-        final String query;
-        MapSqlParameterSource np = new MapSqlParameterSource();
-
-        if (user instanceof KorAPUser) {
-            final KorAPUser k = (KorAPUser) user;
-
-            URIParam param = k.getField(URIParam.class);
-            np.addValue("us", k.getUsername());
-            np.addValue("alo", k.isAccountLocked());
-            np.addValue("ali", k.getAccountLink());
-            np.addValue("ps", k.getPassword());
-            if (param != null) {
-                np.addValue("uri", param.getUriFragment());
-                np.addValue("urie", param.getUriExpiration());
-            }
-            else {
-                np.addValue("uri", null);
-                np.addValue("urie", null);
-            }
-
-            np.addValue("acr", System.currentTimeMillis());
-            np.addValue("id", k.getId());
-
-            if (user.getId() != -1)
-                query = "INSERT INTO korap_users (id, username, account_lock, "
-                        + "account_link, password, uri_fragment, "
-                        + "account_creation, "
-                        + "uri_expiration) VALUES (:id, :us, :alo, :ali, "
-                        + ":ps, :uri, :acr, :urie);";
-            else
-                query = "INSERT INTO korap_users (username, account_lock, "
-                        + "account_link, password, uri_fragment, "
-                        + "account_creation, "
-                        + "uri_expiration) VALUES (:us, :alo, :ali, "
-                        + ":ps, :uri, :acr, :urie);";
-
-            //fixme: still applicable?
-        }
-        else if (user instanceof ShibbolethUser) {
-            ShibbolethUser s = (ShibbolethUser) user;
-
-            query = "INSERT INTO shibusers (username, type, account_link, account_creation "
-                    + "eduPersonScopedAffiliation, cn, mail) "
-                    + "VALUES (:us, :type, :ali, "
-                    + ":edu, :cn, :mail, :logs, :logft);";
-            np.addValue("us", s.getUsername());
-            np.addValue("ali", null);
-            np.addValue("edu", s.getAffiliation());
-            np.addValue("mail", s.getMail());
-            np.addValue("type", user.getType());
-            np.addValue("cn", s.getCommonName());
-            np.addValue("acr", System.currentTimeMillis());
-
-            //todo: deprecate
-            //        }else if (user instanceof DemoUser) {
-            //            query = "INSERT INTO korap_users (id, username, type, account_lock, account_creation) VALUES "
-            //                    + "(:id, :us, :type, :alo);";
-            //
-            //            np.addValue("id", user.getId());
-            //            np.addValue("us", user.getUsername());
-            //            np.addValue("type", user.getType());
-            //            np.addValue("alo", user.isAccountLocked());
-            //            np.addValue("acr", System.currentTimeMillis());
-        }
-        else
-            return -1;
-
-        KeyHolder holder = new GeneratedKeyHolder();
-
-        int r;
-        try {
-            r = this.jdbcTemplate.update(query, np, holder,
-                    new String[] { "id" });
-            user.setId(holder.getKey().intValue());
-        }
-        catch (DuplicateKeyException e) {
-            jlog.error("Could not create user account with username: "+
-                    user.getUsername());
-            throw new DatabaseException(e, user.getUsername(), "korap_users",
-                    StatusCodes.DB_ENTRY_EXISTS, "Username exists.",
-                    user.getUsername());
-        }
-        catch (DataAccessException e) {
-            throw new DatabaseException(e, user.getUsername(), "korap_users",
-                    StatusCodes.DB_ENTRY_EXISTS, "Username exists.",
-                    user.getUsername());
-        }
-
-        return r;
-    }
-
-
-    @Override
-    public int deleteAccount (final Integer userid) throws KustvaktException {
-        MapSqlParameterSource s = new MapSqlParameterSource();
-        s.addValue("user", userid);
-
-        try {
-            int r;
-            r = this.jdbcTemplate
-                    .update("DELETE FROM korap_users WHERE id=:user", s);
-            //            if (user instanceof KorAPUser)
-            //                r = this.jdbcTemplate
-            //                        .update("DELETE FROM korap_users WHERE username=:user",
-            //                                s);
-            //            else if (user instanceof ShibUser)
-            //                r = this.jdbcTemplate
-            //                        .update("DELETE FROM shibusers WHERE username=:user",
-            //                                s);
-            //            else
-            //                r = -1;
-            return r;
-        }
-        catch (DataAccessException e) {
-            jlog.error("Could not delete account for user: " + userid, e);
-            //            throw new KorAPException(e, StatusCodes.CONNECTION_ERROR);
-            throw new DatabaseException(userid, "korap_users",
-                    StatusCodes.DB_DELETE_FAILED,
-                    "Could not delete account for user: " + userid,
-                    userid.toString());
-        }
-
-    }
-
-
-    @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();
-        final String query = "UPDATE korap_users SET "
-                + "uri_expiration=0, password=:pass WHERE uri_fragment=:uri AND uri_expiration > :now "
-                + "AND username=:us AND uri_expiration > :now;";
-        np.addValue("uri", uriToken);
-        np.addValue("now", new Date(TimeUtils.getNow().getMillis()));
-        np.addValue("pass", passphrase);
-        np.addValue("us", username);
-        try {
-            return this.jdbcTemplate.update(query, np);
-        }
-        catch (DataAccessException e) {
-            jlog.error("Could not reset password for name: " + username, e);
-            throw new DatabaseException(username, "korap_users",
-                    StatusCodes.DB_UPDATE_FAILED,
-                    "Could not reset password for username: " + username,
-                    username, uriToken, passphrase);
-        }
-    }
-
-
-    @Override
-    public int activateAccount (String username, String uriToken)
-            throws KustvaktException {
-        MapSqlParameterSource np = new MapSqlParameterSource();
-        final String query = "UPDATE korap_users SET uri_fragment='', "
-                + "uri_expiration=0, account_lock=:lock WHERE uri_fragment=:uri AND username=:us AND "
-                + "uri_expiration > :now;";
-        np.addValue("uri", uriToken);
-        np.addValue("now", TimeUtils.getNow().getMillis());
-        np.addValue("us", username);
-        np.addValue("lock", BooleanUtils.getBoolean(false));
-        try {
-            return this.jdbcTemplate.update(query, np);
-        }
-        catch (DataAccessException e) {
-            jlog.error("Could not confirm registration for name " + username,
-                    e);
-            throw new DatabaseException(username, "korap_users",
-                    StatusCodes.DB_UPDATE_FAILED,
-                    "Could not confirm registration for username " + username,
-                    username, uriToken);
-        }
-    }
-
-
-    @Override
-    public int size () {
-        final String query = "SELECT COUNT(*) FROM korap_users;";
-        return this.jdbcTemplate.queryForObject(query,
-                new HashMap<String, Object>(), Integer.class);
-    }
-
-
-    //todo:
-    public List getAccountLinks (User user) {
-
-        return Collections.emptyList();
-    }
-
-
-    //todo:
-    public void setAccountParameters (User user) {
-        ParamFields fields = user.getFields();
-    }
-}
diff --git a/full/src/main/java/de/ids_mannheim/korap/handlers/JDBCClient.java b/full/src/main/java/de/ids_mannheim/korap/handlers/JDBCClient.java
deleted file mode 100644
index e1c9acd..0000000
--- a/full/src/main/java/de/ids_mannheim/korap/handlers/JDBCClient.java
+++ /dev/null
@@ -1,96 +0,0 @@
-package de.ids_mannheim.korap.handlers;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.sql.SQLException;
-import java.util.HashMap;
-
-import javax.sql.DataSource;
-
-import org.springframework.core.io.InputStreamResource;
-import org.springframework.core.io.Resource;
-import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
-import org.springframework.jdbc.datasource.init.ResourceDatabasePopulator;
-
-import de.ids_mannheim.korap.interfaces.db.PersistenceClient;
-import de.ids_mannheim.korap.utils.BooleanUtils;
-import lombok.AccessLevel;
-import lombok.Data;
-import lombok.Setter;
-
-/**
- * @author hanl
- * @date 13/01/2014
- */
-@Deprecated
-@Data
-public class JDBCClient extends PersistenceClient<NamedParameterJdbcTemplate> {
-
-    @Setter(AccessLevel.NONE)
-    private DataSource dataSource;
-    
-    public JDBCClient (DataSource datasource) {
-        NamedParameterJdbcTemplate template = new NamedParameterJdbcTemplate(
-                datasource);
-        template.setCacheLimit(500);
-        super.setSource(template);
-        this.dataSource = datasource;
-    }
-
-
-    public JDBCClient (DataSource dataSource, Resource resource)
-            throws IOException {
-        this(dataSource);
-        this.setSchema(resource.getInputStream());
-    }
-
-
-    @Override
-    public void setSchema (InputStream stream) throws IOException {
-        super.setSchema(stream);
-    }
-
-
-    @Override
-    public boolean checkDatabase () {
-        int size;
-        NamedParameterJdbcTemplate tmp = this.getSource();
-        try {
-            // uses flyway schema table to determine of schema was applied succesfully
-            size = tmp.queryForObject(
-                    "select count(*) from schema_version limit 5;",
-                    new HashMap<String, Object>(), Integer.class);
-        }
-        catch (Exception e) {
-            System.out.println("No database schema found!");
-            return false;
-        }
-        return size > 0;
-    }
-
-
-    @Override
-    public void setDatabase (String name) {
-        super.setDatabase(name);
-        BooleanUtils.dbname = name;
-    }
-
-
-    // get schema file from configuration and create database
-    @Override
-    public void createDatabase () {
-        if (!checkDatabase()) {
-            final ResourceDatabasePopulator rdp = new ResourceDatabasePopulator();
-            rdp.addScript(new InputStreamResource(this.getSchema()));
-            rdp.setSeparator("$$");
-            try {
-                rdp.populate(this.dataSource.getConnection());
-            }
-            catch (SQLException e) {
-                // do nothing
-                e.printStackTrace();
-            }
-        }
-    }
-
-}
diff --git a/full/src/main/java/de/ids_mannheim/korap/handlers/UserDetailsDao.java b/full/src/main/java/de/ids_mannheim/korap/handlers/UserDetailsDao.java
deleted file mode 100644
index b550dae..0000000
--- a/full/src/main/java/de/ids_mannheim/korap/handlers/UserDetailsDao.java
+++ /dev/null
@@ -1,168 +0,0 @@
-package de.ids_mannheim.korap.handlers;
-
-import de.ids_mannheim.korap.exceptions.KustvaktException;
-import de.ids_mannheim.korap.exceptions.StatusCodes;
-import de.ids_mannheim.korap.exceptions.DatabaseException;
-import de.ids_mannheim.korap.interfaces.db.PersistenceClient;
-import de.ids_mannheim.korap.interfaces.db.UserDataDbIface;
-import de.ids_mannheim.korap.user.User;
-import de.ids_mannheim.korap.user.UserDetails;
-import org.springframework.dao.DataAccessException;
-import org.springframework.dao.EmptyResultDataAccessException;
-import org.springframework.jdbc.core.RowMapper;
-import org.springframework.jdbc.core.namedparam.MapSqlParameterSource;
-import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
-import org.springframework.jdbc.support.GeneratedKeyHolder;
-
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.HashMap;
-
-/**
- * @author hanl
- * @date 27/01/2016
- */
-@Deprecated
-public class UserDetailsDao implements UserDataDbIface<UserDetails> {
-
-    private NamedParameterJdbcTemplate jdbcTemplate;
-
-
-    public UserDetailsDao (PersistenceClient client) {
-        this.jdbcTemplate = (NamedParameterJdbcTemplate) client.getSource();
-    }
-
-
-    @Override
-    public int store (UserDetails data) throws KustvaktException {
-        String sql = "INSERT INTO user_details (user_id, data) VALUES (:userid, :data);";
-        MapSqlParameterSource source = new MapSqlParameterSource();
-        source.addValue("userid", data.getUserId());
-        source.addValue("data", data.serialize());
-
-        GeneratedKeyHolder gen = new GeneratedKeyHolder();
-        try {
-            this.jdbcTemplate.update(sql, source, gen);
-            int id = gen.getKey().intValue();
-            data.setId(id);
-            return id;
-        }
-        catch (DataAccessException e) {
-            return -1;
-        }
-    }
-
-
-    @Override
-    public int update (UserDetails data) throws KustvaktException {
-        String sql = "UPDATE user_details SET data = :data WHERE user_id=:userid;";
-        MapSqlParameterSource source = new MapSqlParameterSource();
-        source.addValue("userid", data.getUserId());
-        source.addValue("data", data.serialize());
-
-        try {
-            return this.jdbcTemplate.update(sql, source);
-        }
-        catch (DataAccessException e) {
-            e.printStackTrace();
-            return -1;
-        }
-    }
-
-
-    @Override
-    public UserDetails get (Integer id) throws DatabaseException {
-        String sql = "SELECT * FROM user_details WHERE id=:id;";
-        MapSqlParameterSource source = new MapSqlParameterSource();
-        source.addValue("id", id);
-
-        try {
-            return this.jdbcTemplate.queryForObject(sql, source,
-                    new RowMapper<UserDetails>() {
-
-                        @Override
-                        public UserDetails mapRow (ResultSet rs, int rowNum)
-                                throws SQLException {
-                            UserDetails details = new UserDetails();
-                            details.setUserId(rs.getInt("user_id"));
-                            details.setId(rs.getInt("id"));
-                            details.setData(rs.getString("data"));
-                            return details;
-                        }
-                    });
-
-        }
-        catch (EmptyResultDataAccessException ex) {
-            return null;
-        }
-        catch (DataAccessException e) {
-            throw new DatabaseException(-1, "userDetails",
-                    StatusCodes.REQUEST_INVALID, "The request is invalid.",
-                    String.valueOf(id));
-        }
-    }
-
-
-    @Override
-    public UserDetails get (User user) throws DatabaseException {
-        String sql = "SELECT * FROM user_details WHERE user_id=:userid;";
-        MapSqlParameterSource source = new MapSqlParameterSource();
-        source.addValue("userid", user.getId());
-
-        try {
-            return this.jdbcTemplate.queryForObject(sql, source,
-                    new RowMapper<UserDetails>() {
-
-                        @Override
-                        public UserDetails mapRow (ResultSet rs, int rowNum)
-                                throws SQLException {
-                            UserDetails details = new UserDetails();
-                            details.setUserId(rs.getInt("user_id"));
-                            details.setId(rs.getInt("id"));
-                            details.setData(rs.getString("data"));
-                            return details;
-                        }
-                    });
-        }
-        catch (EmptyResultDataAccessException ex) {
-            return null;
-        }
-        catch (DataAccessException e) {
-            throw new DatabaseException(user.getId(), "userDetails",
-                    StatusCodes.REQUEST_INVALID, "The request is invalid.");
-        }
-    }
-
-
-    @Override
-    public int delete (UserDetails data) {
-        String sql = "DELETE FROM user_details WHERE id=:id";
-        MapSqlParameterSource source = new MapSqlParameterSource();
-        source.addValue("id", data.getId());
-        try {
-            return this.jdbcTemplate.update(sql, source);
-        }
-        catch (DataAccessException e) {
-            return -1;
-        }
-    }
-
-
-    @Override
-    public int deleteAll () {
-        String sql = "DELETE FROM user_details;";
-        try {
-            return this.jdbcTemplate.update(sql, new HashMap<String, Object>());
-        }
-        catch (DataAccessException e) {
-            e.printStackTrace();
-            return -1;
-        }
-    }
-
-
-    @Override
-    public Class<UserDetails> type () {
-        return UserDetails.class;
-    }
-}
diff --git a/full/src/main/java/de/ids_mannheim/korap/handlers/UserSettingsDao.java b/full/src/main/java/de/ids_mannheim/korap/handlers/UserSettingsDao.java
deleted file mode 100644
index 326ddb3..0000000
--- a/full/src/main/java/de/ids_mannheim/korap/handlers/UserSettingsDao.java
+++ /dev/null
@@ -1,176 +0,0 @@
-package de.ids_mannheim.korap.handlers;
-
-import de.ids_mannheim.korap.exceptions.KustvaktException;
-import de.ids_mannheim.korap.exceptions.StatusCodes;
-import de.ids_mannheim.korap.exceptions.DatabaseException;
-import de.ids_mannheim.korap.interfaces.db.PersistenceClient;
-import de.ids_mannheim.korap.interfaces.db.UserDataDbIface;
-import de.ids_mannheim.korap.user.User;
-import de.ids_mannheim.korap.user.UserSettingProcessor;
-
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
-import org.springframework.dao.DataAccessException;
-import org.springframework.dao.EmptyResultDataAccessException;
-import org.springframework.jdbc.core.RowMapper;
-import org.springframework.jdbc.core.namedparam.MapSqlParameterSource;
-import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
-import org.springframework.jdbc.support.GeneratedKeyHolder;
-
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.HashMap;
-
-/**
- * @author hanl
- * @date 28/01/2016
- */
-@Deprecated
-public class UserSettingsDao implements UserDataDbIface<UserSettingProcessor> {
-
-    private static final Logger jlog = LogManager
-            .getLogger(UserSettingsDao.class);
-
-    private final NamedParameterJdbcTemplate jdbcTemplate;
-
-
-    public UserSettingsDao (PersistenceClient client) {
-        this.jdbcTemplate = (NamedParameterJdbcTemplate) client.getSource();
-    }
-
-
-    @Override
-    public int store (UserSettingProcessor data) throws KustvaktException {
-        String sql = "INSERT INTO user_settings (user_id, data) VALUES (:userid, :data);";
-        MapSqlParameterSource source = new MapSqlParameterSource();
-        source.addValue("userid", data.getUserId());
-        source.addValue("data", data.serialize());
-
-        GeneratedKeyHolder gen = new GeneratedKeyHolder();
-        try {
-            this.jdbcTemplate.update(sql, source, gen);
-            int id = gen.getKey().intValue();
-            data.setId(id);
-            return id;
-        }
-        catch (DataAccessException e) {
-            jlog.error("couldn't store data in db for user with id "+
-                    data.getUserId());
-            return -1;
-        }
-    }
-
-
-    @Override
-    public int update (UserSettingProcessor data) throws KustvaktException {
-        String sql = "UPDATE user_settings SET data = :data WHERE user_id=:userid;";
-        MapSqlParameterSource source = new MapSqlParameterSource();
-        source.addValue("userid", data.getUserId());
-        source.addValue("data", data.serialize());
-
-        try {
-            return this.jdbcTemplate.update(sql, source);
-        }
-        catch (DataAccessException e) {
-            return -1;
-        }
-    }
-
-
-    @Override
-    public UserSettingProcessor get (Integer id) throws DatabaseException {
-        String sql = "SELECT * FROM user_settings WHERE id=:id;";
-        MapSqlParameterSource source = new MapSqlParameterSource();
-        source.addValue("id", id);
-
-        try {
-            return this.jdbcTemplate.queryForObject(sql, source,
-                    new RowMapper<UserSettingProcessor>() {
-
-                        @Override
-                        public UserSettingProcessor mapRow (ResultSet rs, int rowNum)
-                                throws SQLException {
-                            UserSettingProcessor details = new UserSettingProcessor(
-                                    rs.getInt("user_id"));
-                            details.setId(rs.getInt("id"));
-                            details.setData(rs.getString("data"));
-                            return details;
-                        }
-                    });
-
-        }
-        catch (EmptyResultDataAccessException ex) {
-            return null;
-        }
-        catch (DataAccessException e) {
-            throw new DatabaseException(-1, "userSettings",
-                    StatusCodes.REQUEST_INVALID, "The request is invalid.",
-                    String.valueOf(id));
-        }
-    }
-
-
-    @Override
-    public UserSettingProcessor get (User user) throws DatabaseException {
-        String sql = "SELECT * FROM user_settings WHERE user_id=:userid;";
-        MapSqlParameterSource source = new MapSqlParameterSource();
-        source.addValue("userid", user.getId());
-
-        try {
-            return this.jdbcTemplate.queryForObject(sql, source,
-                    new RowMapper<UserSettingProcessor>() {
-
-                        @Override
-                        public UserSettingProcessor mapRow (ResultSet rs, int rowNum)
-                                throws SQLException {
-                            UserSettingProcessor details = new UserSettingProcessor(
-                                    rs.getInt("user_id"));
-                            details.setId(rs.getInt("id"));
-                            details.setData(rs.getString("data"));
-                            return details;
-                        }
-                    });
-
-        }
-        catch (EmptyResultDataAccessException ex) {
-            return null;
-        }
-        catch (DataAccessException e) {
-            throw new DatabaseException(-1, "userSettings",
-                    StatusCodes.REQUEST_INVALID, "The request is invalid.");
-        }
-    }
-
-
-    @Override
-    public int delete (UserSettingProcessor data) {
-        String sql = "DELETE FROM user_settings WHERE id=:id";
-        MapSqlParameterSource source = new MapSqlParameterSource();
-        source.addValue("id", data.getId());
-        try {
-            return this.jdbcTemplate.update(sql, source);
-        }
-        catch (DataAccessException e) {
-            return -1;
-        }
-    }
-
-
-    @Override
-    public int deleteAll () {
-        String sql = "DELETE FROM user_settings;";
-        try {
-            return this.jdbcTemplate.update(sql, new HashMap<String, Object>());
-        }
-        catch (DataAccessException e) {
-            e.printStackTrace();
-            return -1;
-        }
-    }
-
-
-    @Override
-    public Class<UserSettingProcessor> type () {
-        return UserSettingProcessor.class;
-    }
-}
diff --git a/full/src/main/java/de/ids_mannheim/korap/interfaces/KustvaktBaseDaoInterface.java b/full/src/main/java/de/ids_mannheim/korap/interfaces/KustvaktBaseDaoInterface.java
deleted file mode 100644
index 42a2a74..0000000
--- a/full/src/main/java/de/ids_mannheim/korap/interfaces/KustvaktBaseDaoInterface.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package de.ids_mannheim.korap.interfaces;
-
-/**
- * @author hanl
- * @date 11/02/2016
- */
-public interface KustvaktBaseDaoInterface {
-
-    int size ();
-
-
-    int truncate ();
-
-}
diff --git a/full/src/main/java/de/ids_mannheim/korap/interfaces/db/PersistenceClient.java b/full/src/main/java/de/ids_mannheim/korap/interfaces/db/PersistenceClient.java
deleted file mode 100644
index 9fd0f79..0000000
--- a/full/src/main/java/de/ids_mannheim/korap/interfaces/db/PersistenceClient.java
+++ /dev/null
@@ -1,61 +0,0 @@
-package de.ids_mannheim.korap.interfaces.db;
-
-import lombok.Getter;
-
-import java.io.*;
-
-@Getter
-public abstract class PersistenceClient<SOURCE> {
-
-    private SOURCE source;
-    private TYPE type;
-
-    protected String database;
-    private InputStream schema;
-
-
-    public PersistenceClient (String database, TYPE type) {
-        this.type = type;
-        this.database = database;
-    }
-
-
-    public PersistenceClient (TYPE type) {
-        this.type = type;
-    }
-
-
-    public PersistenceClient () {}
-
-
-    protected void setSource (SOURCE conn) {
-        this.source = conn;
-    }
-
-
-    public void setDatabase (String name) {
-        this.database = name;
-    }
-
-
-    public void setSchema (String schema_path) throws FileNotFoundException {
-        this.schema = new FileInputStream(new File(schema_path));
-    }
-
-
-    // for spring configuration
-    @Deprecated
-    public void setSchema (InputStream schema) throws IOException {
-        this.schema = schema;
-    }
-
-
-    public abstract boolean checkDatabase ();
-
-
-    public abstract void createDatabase () throws IOException;
-
-    public enum TYPE {
-        SQL, CASSANDRA
-    }
-}
diff --git a/full/src/main/java/de/ids_mannheim/korap/interfaces/db/UserDataDbIface.java b/full/src/main/java/de/ids_mannheim/korap/interfaces/db/UserDataDbIface.java
deleted file mode 100644
index 23dfbc4..0000000
--- a/full/src/main/java/de/ids_mannheim/korap/interfaces/db/UserDataDbIface.java
+++ /dev/null
@@ -1,32 +0,0 @@
-package de.ids_mannheim.korap.interfaces.db;
-
-import de.ids_mannheim.korap.exceptions.KustvaktException;
-import de.ids_mannheim.korap.interfaces.KustvaktTypeInterface;
-import de.ids_mannheim.korap.user.User;
-import de.ids_mannheim.korap.user.Userdata;
-
-/**
- * @author hanl
- * @date 27/01/2016
- */
-public interface UserDataDbIface<T extends Userdata> extends
-        KustvaktTypeInterface<T> {
-
-    public int store (T data) throws KustvaktException;
-
-
-    public int update (T data) throws KustvaktException;
-
-
-    public T get (Integer id) throws KustvaktException;
-
-
-    public T get (User user) throws KustvaktException;
-
-
-    public int delete (T data) throws KustvaktException;
-
-
-    public int deleteAll () throws KustvaktException;
-
-}
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/controller/AuthenticationController.java b/full/src/main/java/de/ids_mannheim/korap/web/controller/AuthenticationController.java
index 597ae0e..9eac9d4 100644
--- a/full/src/main/java/de/ids_mannheim/korap/web/controller/AuthenticationController.java
+++ b/full/src/main/java/de/ids_mannheim/korap/web/controller/AuthenticationController.java
@@ -430,23 +430,4 @@
         }
     }
 
-
-    //fixme: moved from userservice
-    @GET
-    @Path("logout")
-    @ResourceFilters({ AuthenticationFilter.class, DemoUserFilter.class,
-            PiwikFilter.class })
-    public Response logout (@Context SecurityContext ctx,
-            @Context Locale locale) {
-        TokenContext context = (TokenContext) ctx.getUserPrincipal();
-        try {
-            controller.logout(context);
-        }
-        catch (KustvaktException e) {
-            jlog.error("Logout Exception:"+ e.string());
-            throw kustvaktResponseHandler.throwit(e);
-        }
-        return Response.ok().build();
-    }
-
 }
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/controller/ShibbolethUserController.java b/full/src/main/java/de/ids_mannheim/korap/web/controller/ShibbolethUserController.java
deleted file mode 100644
index ce7ba2b..0000000
--- a/full/src/main/java/de/ids_mannheim/korap/web/controller/ShibbolethUserController.java
+++ /dev/null
@@ -1,340 +0,0 @@
-package de.ids_mannheim.korap.web.controller;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-import java.util.Set;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.SecurityContext;
-import javax.ws.rs.core.UriInfo;
-
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Controller;
-
-import com.fasterxml.jackson.databind.JsonNode;
-import de.ids_mannheim.korap.web.utils.ResourceFilters;
-
-import de.ids_mannheim.korap.authentication.AuthenticationManager;
-import de.ids_mannheim.korap.config.Attributes;
-import de.ids_mannheim.korap.config.Scopes;
-import de.ids_mannheim.korap.exceptions.KustvaktException;
-import de.ids_mannheim.korap.security.context.TokenContext;
-import de.ids_mannheim.korap.user.KorAPUser;
-import de.ids_mannheim.korap.user.User;
-import de.ids_mannheim.korap.user.UserDetails;
-import de.ids_mannheim.korap.user.UserQuery;
-import de.ids_mannheim.korap.user.UserSettingProcessor;
-import de.ids_mannheim.korap.user.Userdata;
-import de.ids_mannheim.korap.utils.JsonUtils;
-import de.ids_mannheim.korap.utils.StringUtils;
-import de.ids_mannheim.korap.web.KustvaktResponseHandler;
-import de.ids_mannheim.korap.web.filter.APIVersionFilter;
-import de.ids_mannheim.korap.web.filter.AuthenticationFilter;
-import de.ids_mannheim.korap.web.filter.BlockingFilter;
-import de.ids_mannheim.korap.web.filter.DemoUserFilter;
-import de.ids_mannheim.korap.web.filter.PiwikFilter;
-
-/** 
- * 
- * @author hanl, margaretha
- */
-@Controller
-@Path("{version}/shibboleth/user")
-@Produces(MediaType.APPLICATION_JSON + ";charset=utf-8")
-@ResourceFilters({APIVersionFilter.class, PiwikFilter.class })
-public class ShibbolethUserController {
-
-    @Autowired
-    private KustvaktResponseHandler kustvaktResponseHandler;
-
-    private static Logger jlog = LogManager.getLogger(ShibbolethUserController.class);
-    @Autowired
-    private AuthenticationManager controller;
-
-    private @Context UriInfo info;
-
-    // EM: may be used for managing shib users
-    //todo: password update in special function? --> password reset only!
-    @POST
-    @Path("update")
-    @Consumes(MediaType.APPLICATION_JSON)
-    @ResourceFilters({ AuthenticationFilter.class, PiwikFilter.class,
-            BlockingFilter.class })
-    public Response updateAccount (@Context SecurityContext ctx, String json) {
-        TokenContext context = (TokenContext) ctx.getUserPrincipal();
-        try {
-            User user = controller.getUser(context.getUsername());
-
-            JsonNode node = JsonUtils.readTree(json);
-            KorAPUser ident = (KorAPUser) user;
-            KorAPUser values = User.UserFactory.toUser(json);
-            //            user = controller
-            //                    .checkPasswordAllowance(ident, values.getPassword(),
-            //                            node.path("new_password").asText());
-            //            controller.updateAccount(user);
-        }
-        catch (KustvaktException e) {
-            throw kustvaktResponseHandler.throwit(e);
-        }
-        return Response.ok().build();
-    }
-    
-    // todo: refactor and make something out of if --> needs to give some sort of feedback!
-    @GET
-    @Path("info")
-    @ResourceFilters({ AuthenticationFilter.class, PiwikFilter.class,
-            BlockingFilter.class })
-    public Response getStatus (@Context SecurityContext context,
-            @QueryParam("scopes") String scopes) {
-        TokenContext ctx = (TokenContext) context.getUserPrincipal();
-        Scopes m;
-        try {
-            User user = controller.getUser(ctx.getUsername());
-            Userdata data = controller.getUserData(user, UserDetails.class);
-
-            Set<String> base_scope = StringUtils.toSet(scopes, " ");
-            if (scopes != null) base_scope.retainAll(StringUtils.toSet(scopes));
-            scopes = StringUtils.toString(base_scope);
-            m = Scopes.mapScopes(scopes, data);
-            return Response.ok(m.toEntity()).build();
-        }
-        catch (KustvaktException e) {
-            throw kustvaktResponseHandler.throwit(e);
-        }
-    }
-
-
-    @GET
-    @Path("settings")
-    @ResourceFilters({ AuthenticationFilter.class, DemoUserFilter.class,
-            PiwikFilter.class, BlockingFilter.class })
-    public Response getUserSettings (@Context SecurityContext context,
-            @Context Locale locale) {
-        TokenContext ctx = (TokenContext) context.getUserPrincipal();
-        String result;
-        try {
-            User user = controller.getUser(ctx.getUsername());
-            Userdata data = controller.getUserData(user, UserSettingProcessor.class);
-            data.setField(Attributes.USERNAME, ctx.getUsername());
-            result = data.serialize();
-        }
-        catch (KustvaktException e) {
-            jlog.error("Exception encountered!", e);
-            throw kustvaktResponseHandler.throwit(e);
-        }
-        return Response.ok(result).build();
-    }
-
-
-    @Deprecated
-    @POST
-    @Path("settings")
-    @Consumes({ MediaType.APPLICATION_JSON })
-    @ResourceFilters({ AuthenticationFilter.class, PiwikFilter.class,
-            BlockingFilter.class })
-    public Response updateSettings (@Context SecurityContext context,
-            @Context Locale locale, Map settings) {
-        TokenContext ctx = (TokenContext) context.getUserPrincipal();
-
-        if (settings == null) return Response.notModified().build();
-
-        try {
-            User user = controller.getUser(ctx.getUsername());
-            if (User.UserFactory.isDemo(ctx.getUsername()))
-                return Response.notModified().build();
-
-            Userdata data = controller.getUserData(user, UserSettingProcessor.class);
-            // todo: check setting only within the scope of user settings permissions; not foundry range. Latter is part of
-            // frontend which only displays available foundries and
-            //            SecurityManager.findbyId(us.getDefaultConstfoundry(), user, Foundry.class);
-            //            SecurityManager.findbyId(us.getDefaultLemmafoundry(), user, Foundry.class);
-            //            SecurityManager.findbyId(us.getDefaultPOSfoundry(), user, Foundry.class);
-            //            SecurityManager.findbyId(us.getDefaultRelfoundry(), user, Foundry.class);
-            Userdata new_data = new UserSettingProcessor(user.getId());
-            new_data.readQuietly((Map<String, Object>) settings, false);
-            data.update(new_data);
-            controller.updateUserData(data);
-        }
-        catch (KustvaktException e) {
-            jlog.error("Exception encountered!", e);
-            throw kustvaktResponseHandler.throwit(e);
-        }
-
-        return Response.ok().build();
-    }
-
-    @GET
-    @Path("details")
-    @ResourceFilters({ AuthenticationFilter.class, DemoUserFilter.class,
-            PiwikFilter.class, BlockingFilter.class })
-    public Response getDetails (@Context SecurityContext context,
-            @Context Locale locale, @QueryParam("pointer") String pointer) {
-        TokenContext ctx = (TokenContext) context.getUserPrincipal();
-        String result;
-        try {
-            User user = controller.getUser(ctx.getUsername());
-            Userdata data = controller.getUserData(user, UserDetails.class);
-            data.setField(Attributes.USERNAME, ctx.getUsername());
-            if (pointer != null)
-                result = data.get(pointer).toString();
-            else
-                result = data.serialize();
-        }
-        catch (KustvaktException e) {
-            jlog.error("Exception encountered: "+ e.string());
-            throw kustvaktResponseHandler.throwit(e);
-        }
-        return Response.ok(result).build();
-    }
-
-
-    // EM: may be used for managing shib users
-    @POST
-    @Path("details")
-    @Consumes({ MediaType.APPLICATION_JSON })
-    @ResourceFilters({ AuthenticationFilter.class, PiwikFilter.class,
-            BlockingFilter.class })
-    public Response updateDetails (@Context SecurityContext context,
-            @Context Locale locale, Map details) {
-        TokenContext ctx = (TokenContext) context.getUserPrincipal();
-
-        if (details == null) return Response.notModified().build();
-
-        try {
-            User user = controller.getUser(ctx.getUsername());
-            if (User.UserFactory.isDemo(ctx.getUsername()))
-                return Response.notModified().build();
-
-            UserDetails new_data = new UserDetails(user.getId());
-            new_data.readQuietly((Map<String, Object>) details, false);
-
-            UserDetails det = controller.getUserData(user, UserDetails.class);
-            det.update(new_data);
-            controller.updateUserData(det);
-        }
-        catch (KustvaktException e) {
-            jlog.error("Exception encountered!", e);
-            throw kustvaktResponseHandler.throwit(e);
-        }
-        return Response.ok().build();
-    }
-
-
-    //fixme: if policy allows, foreign user might be allowed to change search!
-    @POST
-    @Path("queries")
-    @Consumes(MediaType.APPLICATION_JSON)
-    @ResourceFilters({ AuthenticationFilter.class, PiwikFilter.class,
-            BlockingFilter.class })
-    public Response updateQueries (@Context SecurityContext context,
-            String json) {
-        TokenContext ctx = (TokenContext) context.getUserPrincipal();
-        Collection<UserQuery> add = new HashSet<>();
-        try {
-            User user = controller.getUser(ctx.getUsername());
-            List<UserQuery> userQuieres = new ArrayList<>();
-            JsonNode nodes = JsonUtils.readTree(json);
-            Iterator<JsonNode> node = nodes.elements();
-            while (node.hasNext()) {
-                JsonNode cursor = node.next();
-                UserQuery query =
-                        new UserQuery(cursor.path("id").asInt(), user.getId());
-                query.setQueryLanguage(cursor.path("queryLanguage").asText());
-                query.setQuery(cursor.path("query").asText());
-                query.setDescription(cursor.path("description").asText());
-                userQuieres.add(query);
-            }
-
-            //1: add all that are new, update all that are retained, delete the rest
-            //            Set<UserQuery> resources = ResourceFinder
-            //                    .search(user, UserQuery.class);
-            //
-            //            add.addAll(userQuieres);
-            //            add.removeAll(resources);
-            //            Collection<UserQuery> update = new HashSet<>(userQuieres);
-            //            update.retainAll(resources);
-            //            resources.removeAll(userQuieres);
-            //
-            //            if (!update.isEmpty()) {
-            //                resourceHandler.updateResources(user,
-            //                        update.toArray(new UserQuery[update.size()]));
-            //            }
-            //            if (!add.isEmpty()) {
-            //                resourceHandler.storeResources(user,
-            //                        add.toArray(new UserQuery[add.size()]));
-            //            }
-            //            if (!resources.isEmpty()) {
-            //                resourceHandler.deleteResources(user,
-            //                        resources.toArray(new UserQuery[resources.size()]));
-            //            }
-        }
-        catch (KustvaktException e) {
-            jlog.error("Exception encountered!", e);
-            throw kustvaktResponseHandler.throwit(e);
-        }
-        try {
-            return Response.ok(JsonUtils.toJSON(add)).build();
-        }
-        catch (KustvaktException e) {
-            throw kustvaktResponseHandler.throwit(e);
-        }
-    }
-
-    // EM: may be used for managing shib users
-    @DELETE
-    @ResourceFilters({ AuthenticationFilter.class, PiwikFilter.class,
-            BlockingFilter.class })
-    public Response deleteUser (@Context SecurityContext context) {
-        TokenContext ctx = (TokenContext) context.getUserPrincipal();
-        try {
-            User user = controller.getUser(ctx.getUsername());
-            //todo: test that demo user cannot be deleted!
-            controller.deleteAccount(user);
-        }
-        catch (KustvaktException e) {
-            jlog.error("Exception encountered!", e);
-            throw kustvaktResponseHandler.throwit(e);
-        }
-        return Response.ok().build();
-    }
-
-
-    @GET
-    @Path("queries")
-    @ResourceFilters({ AuthenticationFilter.class, DemoUserFilter.class,
-            PiwikFilter.class, BlockingFilter.class })
-    public Response getQueries (@Context SecurityContext context,
-            @Context Locale locale) {
-        TokenContext ctx = (TokenContext) context.getUserPrincipal();
-        String queryStr;
-        try {
-            User user = controller.getUser(ctx.getUsername());
-            //            Set<UserQuery> queries = ResourceFinder
-            //                    .search(user, UserQuery.class);
-            //            queryStr = JsonUtils.toJSON(queries);
-            //todo:
-            queryStr = "";
-        }
-        catch (KustvaktException e) {
-            jlog.error("Exception encountered!", e);
-            throw kustvaktResponseHandler.throwit(e);
-        }
-        return Response.ok(queryStr).build();
-    }
-}
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/filter/PiwikFilter.java b/full/src/main/java/de/ids_mannheim/korap/web/filter/PiwikFilter.java
index 5a9f19a..955e219 100644
--- a/full/src/main/java/de/ids_mannheim/korap/web/filter/PiwikFilter.java
+++ b/full/src/main/java/de/ids_mannheim/korap/web/filter/PiwikFilter.java
@@ -8,41 +8,29 @@
 import java.util.Map;
 import java.util.Random;
 
-import javax.ws.rs.core.SecurityContext;
+import javax.ws.rs.client.Client;
+import javax.ws.rs.client.ClientBuilder;
+import javax.ws.rs.client.WebTarget;
+import javax.ws.rs.container.ContainerRequestContext;
+import javax.ws.rs.container.ContainerRequestFilter;
 import javax.ws.rs.core.UriBuilder;
 
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-import javax.annotation.Priority;
-import javax.ws.rs.Priorities;
-import javax.ws.rs.container.ContainerRequestContext;
-import javax.ws.rs.container.ContainerRequestFilter;
-
-import javax.ws.rs.client.Client;
-import javax.ws.rs.client.ClientBuilder;
-import javax.ws.rs.client.WebTarget;
-
 import org.glassfish.jersey.client.ClientConfig;
 import org.glassfish.jersey.logging.LoggingFeature;
+import org.springframework.beans.factory.annotation.Autowired;
 
 import de.ids_mannheim.korap.authentication.AuthenticationManager;
-import de.ids_mannheim.korap.config.Attributes;
-import de.ids_mannheim.korap.exceptions.KustvaktException;
-import de.ids_mannheim.korap.security.context.TokenContext;
-import de.ids_mannheim.korap.user.User;
-import de.ids_mannheim.korap.user.UserSettingProcessor;
-import de.ids_mannheim.korap.user.Userdata;
 import net.minidev.json.JSONArray;
 
 /**
  * @author hanl
  * @date 13/05/2014
  */
-@Component
-@Priority(Priorities.AUTHORIZATION)
+@Deprecated
+//@Component
+//@Priority(Priorities.AUTHORIZATION)
 public class PiwikFilter implements ContainerRequestFilter {
 
     private WebTarget service;
@@ -121,25 +109,25 @@
     @Override
     public void filter (ContainerRequestContext request) {
         if (ENABLED) {
-            try {
-                TokenContext context;
-                SecurityContext securityContext = request.getSecurityContext();
-                if (securityContext != null) {
-                    context = (TokenContext) securityContext.getUserPrincipal();
-
-                    if (context.getUsername() != null){
-                        // since this is cached, not very expensive!
-                        User user = authenticationManager.getUser(context.getUsername());
-                        Userdata data = authenticationManager
-                                .getUserData(user, UserSettingProcessor.class);
-                        if ((Boolean) data.get(Attributes.COLLECT_AUDITING_DATA))
-                            customVars.put("username", context.getUsername());
-                    }
-                }
-            }
-            catch (KustvaktException e) {
-                //do nothing
-            }
+//            try {
+//                TokenContext context;
+//                SecurityContext securityContext = request.getSecurityContext();
+//                if (securityContext != null) {
+//                    context = (TokenContext) securityContext.getUserPrincipal();
+//
+//                    if (context.getUsername() != null){
+//                        // since this is cached, not very expensive!
+//                        User user = authenticationManager.getUser(context.getUsername());
+//                        Userdata data = authenticationManager
+//                                .getUserData(user, UserSettingProcessor.class);
+//                        if ((Boolean) data.get(Attributes.COLLECT_AUDITING_DATA))
+//                            customVars.put("username", context.getUsername());
+//                    }
+//                }
+//            }
+//            catch (KustvaktException e) {
+//                //do nothing
+//            }
             send(request);
         }
     }
diff --git a/full/src/main/resources/default-config.xml b/full/src/main/resources/default-config.xml
index 491dcdb..7882650 100644
--- a/full/src/main/resources/default-config.xml
+++ b/full/src/main/resources/default-config.xml
@@ -122,12 +122,6 @@
 		<constructor-arg ref="flywayConfig"/>
 	</bean>
 
-	<bean id="kustvakt_db" class="de.ids_mannheim.korap.handlers.JDBCClient">
-		<constructor-arg index="0" ref="dataSource" />
-		<!-- deprecated property -->
-		<property name="database" value="${jdbc.database}" />
-	</bean>
-
 	<bean id="entityManagerFactory"
 		class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"
 		depends-on="flyway">
@@ -254,10 +248,6 @@
 		<constructor-arg index="0" ref="mdGenerator" />
 	</bean>
 
-	<bean id="kustvakt_userdb" class="de.ids_mannheim.korap.handlers.EntityDao">
-		<constructor-arg ref="kustvakt_db" />
-	</bean>
-
 	<bean name="kustvakt_encryption" class="de.ids_mannheim.korap.encryption.KustvaktEncryption">
 		<constructor-arg ref="kustvakt_config" />
 	</bean>
@@ -291,29 +281,12 @@
 	</util:list>
 
 
-	<bean id="userdata_details" class="de.ids_mannheim.korap.handlers.UserDetailsDao">
-		<constructor-arg ref="kustvakt_db" />
-	</bean>
-
-	<bean id="userdata_settings" class="de.ids_mannheim.korap.handlers.UserSettingsDao">
-		<constructor-arg 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="authenticationManager"
 		class="de.ids_mannheim.korap.authentication.KustvaktAuthenticationManager">
-		<constructor-arg type="de.ids_mannheim.korap.interfaces.EntityHandlerIface"
-			ref="kustvakt_userdb" />
 		<constructor-arg type="de.ids_mannheim.korap.interfaces.EncryptionIface"
 			ref="kustvakt_encryption" />
 		<constructor-arg ref="kustvakt_config" />
-		<constructor-arg ref="kustvakt_userdata" />
 		<!-- inject authentication providers to use -->
 		<property name="providers" ref="kustvakt_authproviders" />
 	</bean>
diff --git a/full/src/test/java/de/ids_mannheim/korap/authentication/KustvaktAuthenticationManagerTest.java b/full/src/test/java/de/ids_mannheim/korap/authentication/KustvaktAuthenticationManagerTest.java
deleted file mode 100644
index 6c2834b..0000000
--- a/full/src/test/java/de/ids_mannheim/korap/authentication/KustvaktAuthenticationManagerTest.java
+++ /dev/null
@@ -1,92 +0,0 @@
-package de.ids_mannheim.korap.authentication;
-
-import static org.junit.Assert.assertNotNull;
-
-import org.junit.After;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import de.ids_mannheim.korap.config.Attributes;
-import de.ids_mannheim.korap.config.BeanConfigTest;
-import de.ids_mannheim.korap.config.KustvaktConfiguration;
-import de.ids_mannheim.korap.exceptions.KustvaktException;
-import de.ids_mannheim.korap.user.KorAPUser;
-import de.ids_mannheim.korap.user.User;
-import de.ids_mannheim.korap.user.UserDetails;
-import de.ids_mannheim.korap.user.UserSettingProcessor;
-import de.ids_mannheim.korap.user.Userdata;
-
-/**
- * EM: fix tests. new DB does not save users.
- * @author hanl
- * @date 04/02/2016
- */
-@Ignore
-public class KustvaktAuthenticationManagerTest extends BeanConfigTest {
-
-    @Autowired
-    private AuthenticationManager authenticationManager;
-    
-    @After
-    public void after () {
-        try {
-            User user = authenticationManager
-                    .getUser(
-                            (String) KustvaktConfiguration.KUSTVAKT_USER
-                                    .get(Attributes.USERNAME));
-            authenticationManager
-                    .deleteAccount(user);
-        }
-        catch (KustvaktException e) {}
-    }
-
-    @Test
-    public void testBatchStore () {
-        int i = 6;
-
-//        AuthenticationManagerIface manager = helper().getContext()
-//                .getAuthenticationManager();
-        for (int ix = 0; ix < i; ix++) {}
-
-    }
-
-
-    @Test
-    @Ignore
-    public void testUserdetailsGet () throws KustvaktException {
-        User user = authenticationManager
-                .getUser((String) KustvaktConfiguration.KUSTVAKT_USER
-                        .get(Attributes.USERNAME));
-
-        Userdata data = authenticationManager.getUserData(user, UserDetails.class);
-        assertNotNull(data);
-    }
-
-
-    @Test
-    @Ignore
-    public void testUsersettingsGet () throws KustvaktException {
-        User user = authenticationManager
-                .getUser((String) KustvaktConfiguration.KUSTVAKT_USER
-                        .get(Attributes.USERNAME));
-
-        Userdata data = authenticationManager.getUserData(user, UserSettingProcessor.class);
-        assertNotNull(data);
-    }
-
-
-    @Test(expected = KustvaktException.class)
-    public void testUserDetailsGetNonExistent () throws KustvaktException {
-        User user = new KorAPUser(10, "random");
-        authenticationManager.getUserData(user, UserDetails.class);
-    }
-
-
-    @Test(expected = KustvaktException.class)
-    public void testUserSettingsGetNonExistent () throws KustvaktException {
-        User user = new KorAPUser(10, "random");
-        authenticationManager.getUserData(user, UserSettingProcessor.class);
-    }
-
-}
diff --git a/full/src/test/java/de/ids_mannheim/korap/config/BeanConfigTest.java b/full/src/test/java/de/ids_mannheim/korap/config/BeanConfigTest.java
index 0de7e58..3b308b0 100644
--- a/full/src/test/java/de/ids_mannheim/korap/config/BeanConfigTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/config/BeanConfigTest.java
@@ -13,7 +13,6 @@
 import org.springframework.test.context.ContextConfiguration;
 import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
 
-import de.ids_mannheim.korap.exceptions.KustvaktException;
 import net.jcip.annotations.NotThreadSafe;
 
 /**
diff --git a/full/src/test/java/de/ids_mannheim/korap/misc/BeanInjectTest.java b/full/src/test/java/de/ids_mannheim/korap/misc/BeanInjectTest.java
deleted file mode 100644
index 4de83e0..0000000
--- a/full/src/test/java/de/ids_mannheim/korap/misc/BeanInjectTest.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package de.ids_mannheim.korap.misc;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-
-import java.util.Collection;
-
-import org.junit.Test;
-import org.springframework.aop.support.AopUtils;
-
-import de.ids_mannheim.korap.config.BeansFactory;
-import de.ids_mannheim.korap.handlers.UserDetailsDao;
-import de.ids_mannheim.korap.handlers.UserSettingsDao;
-import de.ids_mannheim.korap.user.UserDetails;
-import de.ids_mannheim.korap.user.UserSettingProcessor;
-
-/**
- * Created by hanl on 03.06.16.
- */
-public class BeanInjectTest {
-
-    @Test
-    public void testUserBeans () {
-        BeansFactory.loadClasspathContext("test-config.xml");
-        Collection coll = BeansFactory.getKustvaktContext()
-                .getUserDataProviders();
-        assertFalse(coll.isEmpty());
-        Object o = BeansFactory.getTypeFactory().getTypeInterfaceBean(coll,
-                UserSettingProcessor.class);
-        assertEquals(UserSettingsDao.class, AopUtils.getTargetClass(o));
-
-        o = BeansFactory.getTypeFactory().getTypeInterfaceBean(coll,
-                UserDetails.class);
-        assertEquals(UserDetailsDao.class, AopUtils.getTargetClass(o));
-        BeansFactory.closeApplication();
-    }
-
-}
diff --git a/full/src/test/resources/test-config-icc.xml b/full/src/test/resources/test-config-icc.xml
index 072f5ff..fed99a6 100644
--- a/full/src/test/resources/test-config-icc.xml
+++ b/full/src/test/resources/test-config-icc.xml
@@ -114,12 +114,6 @@
 	</bean>
 	
 
-	<bean id="kustvakt_db" class="de.ids_mannheim.korap.handlers.JDBCClient">
-		<!-- <constructor-arg index="0" ref="dataSource" /> -->
-		<constructor-arg index="0" ref="sqliteDataSource" />
-		<property name="database" value="${jdbc.database}" />
-	</bean>
-
 	<bean id="entityManagerFactory"
 		class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
 		<!-- <property name="dataSource" ref="dataSource" /> -->
@@ -240,10 +234,6 @@
 		<constructor-arg index="0" ref="mdGenerator" />
 	</bean>
 
-	<bean id="kustvakt_userdb" class="de.ids_mannheim.korap.handlers.EntityDao">
-		<constructor-arg ref="kustvakt_db" />
-	</bean>
-
 	<bean name="kustvakt_encryption" class="de.ids_mannheim.korap.encryption.KustvaktEncryption">
 		<constructor-arg ref="kustvakt_config" />
 	</bean>
@@ -263,29 +253,12 @@
 	</util:list>
 
 
-	<bean id="userdata_details" class="de.ids_mannheim.korap.handlers.UserDetailsDao">
-		<constructor-arg ref="kustvakt_db" />
-	</bean>
-
-	<bean id="userdata_settings" class="de.ids_mannheim.korap.handlers.UserSettingsDao">
-		<constructor-arg 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="authenticationManager"
 		class="de.ids_mannheim.korap.authentication.KustvaktAuthenticationManager">
-		<constructor-arg type="de.ids_mannheim.korap.interfaces.EntityHandlerIface"
-			ref="kustvakt_userdb" />
 		<constructor-arg type="de.ids_mannheim.korap.interfaces.EncryptionIface"
 			ref="kustvakt_encryption" />
 		<constructor-arg ref="kustvakt_config" />
-		<constructor-arg ref="kustvakt_userdata" />
 		<!-- inject authentication providers to use -->
 		<property name="providers" ref="kustvakt_authproviders" />
 	</bean>
diff --git a/full/src/test/resources/test-config.xml b/full/src/test/resources/test-config.xml
index d86cb8d..4ef13dc 100644
--- a/full/src/test/resources/test-config.xml
+++ b/full/src/test/resources/test-config.xml
@@ -114,12 +114,6 @@
 	</bean>
 	
 
-	<bean id="kustvakt_db" class="de.ids_mannheim.korap.handlers.JDBCClient">
-		<!-- <constructor-arg index="0" ref="dataSource" /> -->
-		<constructor-arg index="0" ref="sqliteDataSource" />
-		<property name="database" value="${jdbc.database}" />
-	</bean>
-
 	<bean id="entityManagerFactory"
 		class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
 		<!-- <property name="dataSource" ref="dataSource" /> -->
@@ -236,10 +230,6 @@
 		<constructor-arg index="0" ref="mdGenerator" />
 	</bean>
 
-	<bean id="kustvakt_userdb" class="de.ids_mannheim.korap.handlers.EntityDao">
-		<constructor-arg ref="kustvakt_db" />
-	</bean>
-
 	<bean name="kustvakt_encryption" class="de.ids_mannheim.korap.encryption.KustvaktEncryption">
 		<constructor-arg ref="kustvakt_config" />
 	</bean>
@@ -277,30 +267,12 @@
 		<ref bean="oauth2_auth" />
 	</util:list>
 
-
-	<bean id="userdata_details" class="de.ids_mannheim.korap.handlers.UserDetailsDao">
-		<constructor-arg ref="kustvakt_db" />
-	</bean>
-
-	<bean id="userdata_settings" class="de.ids_mannheim.korap.handlers.UserSettingsDao">
-		<constructor-arg 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="authenticationManager"
 		class="de.ids_mannheim.korap.authentication.KustvaktAuthenticationManager">
-		<constructor-arg type="de.ids_mannheim.korap.interfaces.EntityHandlerIface"
-			ref="kustvakt_userdb" />
 		<constructor-arg type="de.ids_mannheim.korap.interfaces.EncryptionIface"
 			ref="kustvakt_encryption" />
 		<constructor-arg ref="kustvakt_config" />
-		<constructor-arg ref="kustvakt_userdata" />
 		<!-- inject authentication providers to use -->
 		<property name="providers" ref="kustvakt_authproviders" />
 	</bean>
