diff --git a/src/main/java/de/ids_mannheim/korap/handlers/UserDetailsDao.java b/src/main/java/de/ids_mannheim/korap/handlers/UserDetailsDao.java
index 071a74a..b9fd4dd 100644
--- a/src/main/java/de/ids_mannheim/korap/handlers/UserDetailsDao.java
+++ b/src/main/java/de/ids_mannheim/korap/handlers/UserDetailsDao.java
@@ -3,7 +3,7 @@
 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.Userdetails2;
+import de.ids_mannheim.korap.user.UserDetails;
 import org.springframework.dao.DataAccessException;
 import org.springframework.jdbc.core.RowMapper;
 import org.springframework.jdbc.core.namedparam.MapSqlParameterSource;
@@ -18,7 +18,7 @@
  * @author hanl
  * @date 27/01/2016
  */
-public class UserDetailsDao implements UserDataDbIface<Userdetails2> {
+public class UserDetailsDao implements UserDataDbIface<UserDetails> {
 
     private NamedParameterJdbcTemplate jdbcTemplate;
 
@@ -27,7 +27,7 @@
     }
 
     @Override
-    public int store(Userdetails2 data) {
+    public int store(UserDetails data) {
         String sql = "INSERT INTO user_details2 (user_id, data) VALUES (:userid, :data);";
         MapSqlParameterSource source = new MapSqlParameterSource();
         source.addValue("userid", data.getUserID());
@@ -46,7 +46,7 @@
     }
 
     @Override
-    public int update(Userdetails2 data) {
+    public int update(UserDetails data) {
         String sql = "UPDATE user_details2 SET data = :data WHERE user_id=:userid;";
         MapSqlParameterSource source = new MapSqlParameterSource();
         source.addValue("userid", data.getUserID());
@@ -60,19 +60,19 @@
     }
 
     @Override
-    public Userdetails2 get(Integer id) {
+    public UserDetails get(Integer id) {
         String sql = "SELECT * FROM user_details2 WHERE id=:id;";
         MapSqlParameterSource source = new MapSqlParameterSource();
         source.addValue("id", id);
 
         try {
             return this.jdbcTemplate
-                    .queryForObject(sql, source, new RowMapper<Userdetails2>() {
+                    .queryForObject(sql, source, new RowMapper<UserDetails>() {
 
                         @Override
-                        public Userdetails2 mapRow(ResultSet rs, int rowNum)
+                        public UserDetails mapRow(ResultSet rs, int rowNum)
                                 throws SQLException {
-                            Userdetails2 details = new Userdetails2(
+                            UserDetails details = new UserDetails(
                                     rs.getInt("user_id"));
                             details.setId(rs.getInt("id"));
                             details.setData(rs.getString("data"));
@@ -86,19 +86,19 @@
     }
 
     @Override
-    public Userdetails2 get(User user) {
+    public UserDetails get(User user) {
         String sql = "SELECT * FROM user_details2 WHERE user_id=:userid;";
         MapSqlParameterSource source = new MapSqlParameterSource();
         source.addValue("userid", user.getId());
 
         try {
             return this.jdbcTemplate
-                    .queryForObject(sql, source, new RowMapper<Userdetails2>() {
+                    .queryForObject(sql, source, new RowMapper<UserDetails>() {
 
                         @Override
-                        public Userdetails2 mapRow(ResultSet rs, int rowNum)
+                        public UserDetails mapRow(ResultSet rs, int rowNum)
                                 throws SQLException {
-                            Userdetails2 details = new Userdetails2(
+                            UserDetails details = new UserDetails(
                                     rs.getInt("user_id"));
                             details.setId(rs.getInt("id"));
                             details.setData(rs.getString("data"));
@@ -113,7 +113,7 @@
     }
 
     @Override
-    public int delete(Userdetails2 data) {
+    public int delete(UserDetails data) {
         String sql = "DELETE FROM user_details2 WHERE id=:id";
         MapSqlParameterSource source = new MapSqlParameterSource();
         source.addValue("id", data.getId());
diff --git a/src/main/java/de/ids_mannheim/korap/handlers/UserSettingsDao.java b/src/main/java/de/ids_mannheim/korap/handlers/UserSettingsDao.java
index dfc8830..948eae3 100644
--- a/src/main/java/de/ids_mannheim/korap/handlers/UserSettingsDao.java
+++ b/src/main/java/de/ids_mannheim/korap/handlers/UserSettingsDao.java
@@ -3,7 +3,7 @@
 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.UserSettings2;
+import de.ids_mannheim.korap.user.UserSettings;
 import org.springframework.dao.DataAccessException;
 import org.springframework.jdbc.core.RowMapper;
 import org.springframework.jdbc.core.namedparam.MapSqlParameterSource;
@@ -18,7 +18,7 @@
  * @author hanl
  * @date 28/01/2016
  */
-public class UserSettingsDao implements UserDataDbIface<UserSettings2> {
+public class UserSettingsDao implements UserDataDbIface<UserSettings> {
 
     NamedParameterJdbcTemplate jdbcTemplate;
 
@@ -26,7 +26,7 @@
         this.jdbcTemplate = (NamedParameterJdbcTemplate) client.getSource();
     }
     @Override
-    public int store(UserSettings2 data) {
+    public int store(UserSettings data) {
         String sql = "INSERT INTO user_settings2 (user_id, data) VALUES (:userid, :data);";
         MapSqlParameterSource source = new MapSqlParameterSource();
         source.addValue("userid", data.getUserID());
@@ -45,7 +45,7 @@
     }
 
     @Override
-    public int update(UserSettings2 data) {
+    public int update(UserSettings data) {
         String sql = "UPDATE user_settings2 SET data = :data WHERE user_id=:userid;";
         MapSqlParameterSource source = new MapSqlParameterSource();
         source.addValue("userid", data.getUserID());
@@ -59,19 +59,19 @@
     }
 
     @Override
-    public UserSettings2 get(Integer id) {
+    public UserSettings get(Integer id) {
         String sql = "SELECT * FROM user_settings2 WHERE id=:id;";
         MapSqlParameterSource source = new MapSqlParameterSource();
         source.addValue("id", id);
 
         try {
             return this.jdbcTemplate
-                    .queryForObject(sql, source, new RowMapper<UserSettings2>() {
+                    .queryForObject(sql, source, new RowMapper<UserSettings>() {
 
                         @Override
-                        public UserSettings2 mapRow(ResultSet rs, int rowNum)
+                        public UserSettings mapRow(ResultSet rs, int rowNum)
                                 throws SQLException {
-                            UserSettings2 details = new UserSettings2(
+                            UserSettings details = new UserSettings(
                                     rs.getInt("user_id"));
                             details.setId(rs.getInt("id"));
                             details.setData(rs.getString("data"));
@@ -85,19 +85,19 @@
     }
 
     @Override
-    public UserSettings2 get(User user) {
+    public UserSettings get(User user) {
         String sql = "SELECT * FROM user_settings2 WHERE user_id=:userid;";
         MapSqlParameterSource source = new MapSqlParameterSource();
         source.addValue("userid", user.getId());
 
         try {
             return this.jdbcTemplate
-                    .queryForObject(sql, source, new RowMapper<UserSettings2>() {
+                    .queryForObject(sql, source, new RowMapper<UserSettings>() {
 
                         @Override
-                        public UserSettings2 mapRow(ResultSet rs, int rowNum)
+                        public UserSettings mapRow(ResultSet rs, int rowNum)
                                 throws SQLException {
-                            UserSettings2 details = new UserSettings2(
+                            UserSettings details = new UserSettings(
                                     rs.getInt("user_id"));
                             details.setId(rs.getInt("id"));
                             details.setData(rs.getString("data"));
@@ -112,7 +112,7 @@
     }
 
     @Override
-    public int delete(UserSettings2 data) {
+    public int delete(UserSettings data) {
         String sql = "DELETE FROM user_settings2 WHERE id=:id";
         MapSqlParameterSource source = new MapSqlParameterSource();
         source.addValue("id", data.getId());
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 e6393e9..a53cf73 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
@@ -156,7 +156,7 @@
                 Attributes.API_AUTHENTICATION);
 
         if (attr.get(Attributes.SCOPES) != null)
-            this.getUserData(user, Userdetails2.class);
+            this.getUserData(user, UserDetails.class);
 
         TokenContext context = provider.createUserSession(user, attr);
         if (context == null)
@@ -496,16 +496,16 @@
         user.setPassword(hash);
         try {
             entHandler.createAccount(user);
-            Userdetails2 details = new Userdetails2(user.getId());
+            UserDetails details = new UserDetails(user.getId());
             details.readDefaults(safeMap);
             details.checkRequired();
 
-            UserSettings2 settings = new UserSettings2(user.getId());
+            UserSettings settings = new UserSettings(user.getId());
             settings.readDefaults(safeMap);
             settings.checkRequired();
 
-            UserdataFactory.getDaoInstance(Userdetails2.class).store(details);
-            UserdataFactory.getDaoInstance(UserSettings2.class).store(settings);
+            UserdataFactory.getDaoInstance(UserDetails.class).store(details);
+            UserdataFactory.getDaoInstance(UserSettings.class).store(settings);
         }catch (KustvaktException e) {
             throw new WrappedException(e, StatusCodes.CREATE_ACCOUNT_FAILED,
                     user.toString());
@@ -642,7 +642,7 @@
                     username), StatusCodes.PASSWORD_RESET_FAILED, username);
         }
 
-        Userdata data = this.getUserData(ident, Userdetails2.class);
+        Userdata data = this.getUserData(ident, UserDetails.class);
         KorAPUser user = (KorAPUser) ident;
 
         if (!mail.equals(data.get(Attributes.EMAIL)))
diff --git a/src/main/java/de/ids_mannheim/korap/user/Userdetails2.java b/src/main/java/de/ids_mannheim/korap/user/Userdetails.java
similarity index 87%
rename from src/main/java/de/ids_mannheim/korap/user/Userdetails2.java
rename to src/main/java/de/ids_mannheim/korap/user/Userdetails.java
index 0f40f57..47ca9f7 100644
--- a/src/main/java/de/ids_mannheim/korap/user/Userdetails2.java
+++ b/src/main/java/de/ids_mannheim/korap/user/Userdetails.java
@@ -5,9 +5,9 @@
  * @date 22/01/2016
  * persistence issue with query request
  */
-public class Userdetails2 extends Userdata {
+public class UserDetails extends Userdata {
 
-    public Userdetails2(Integer userid) {
+    public UserDetails(Integer userid) {
         super(userid);
     }
 
diff --git a/src/main/java/de/ids_mannheim/korap/user/UserSettings2.java b/src/main/java/de/ids_mannheim/korap/user/Usersettings.java
similarity index 76%
rename from src/main/java/de/ids_mannheim/korap/user/UserSettings2.java
rename to src/main/java/de/ids_mannheim/korap/user/Usersettings.java
index d6b86a9..dd4190c 100644
--- a/src/main/java/de/ids_mannheim/korap/user/UserSettings2.java
+++ b/src/main/java/de/ids_mannheim/korap/user/Usersettings.java
@@ -4,10 +4,10 @@
  * @author hanl
  * @date 28/01/2016
  */
-public class UserSettings2 extends Userdata {
+public class UserSettings extends Userdata {
 
 
-    public UserSettings2(Integer userid) {
+    public UserSettings(Integer userid) {
         super(userid);
     }
 
diff --git a/src/main/java/de/ids_mannheim/korap/web/filter/PiwikFilter.java b/src/main/java/de/ids_mannheim/korap/web/filter/PiwikFilter.java
index 1d886ed..9c9cd9c 100644
--- a/src/main/java/de/ids_mannheim/korap/web/filter/PiwikFilter.java
+++ b/src/main/java/de/ids_mannheim/korap/web/filter/PiwikFilter.java
@@ -115,7 +115,7 @@
                 // since this is cached, not very expensive!
                 User user = controller.getUser(context.getUsername());
                 Userdata data = controller
-                        .getUserData(user, UserSettings2.class);
+                        .getUserData(user, UserSettings.class);
                 if ((Boolean) data.get(Attributes.COLLECT_AUDITING_DATA))
                     customVars.put("username", context.getUsername());
             }catch (KustvaktException | UnsupportedOperationException e) {
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 86424c5..5199855 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
@@ -116,7 +116,7 @@
         try {
             User user = controller.authenticate(0, values[0], values[1], attr);
             Userdata data = this.controller
-                    .getUserData(user, Userdetails2.class);
+                    .getUserData(user, UserDetails.class);
             // todo: is this necessary?
 //            attr.putAll(data.fields());
             context = controller.createTokenContext(user, attr,
diff --git a/src/main/java/de/ids_mannheim/korap/web/service/full/OAuthService.java b/src/main/java/de/ids_mannheim/korap/web/service/full/OAuthService.java
index c516364..5e5e2cf 100644
--- a/src/main/java/de/ids_mannheim/korap/web/service/full/OAuthService.java
+++ b/src/main/java/de/ids_mannheim/korap/web/service/full/OAuthService.java
@@ -126,7 +126,7 @@
         try {
             User user = this.controller.getUser(ctx.getUsername());
             Userdata data = this.controller
-                    .getUserData(user, Userdetails2.class);
+                    .getUserData(user, UserDetails.class);
             details = data.fields();
             Set<String> base_scope = StringUtils.toSet(scopes, " ");
             base_scope.retainAll(StringUtils.toSet(scopes));
@@ -199,7 +199,7 @@
             try {
                 user = controller.getUser(c.getUsername());
                 Userdata data = controller
-                        .getUserData(user, Userdetails2.class);
+                        .getUserData(user, UserDetails.class);
                 user.addUserData(data);
             }catch (KustvaktException e) {
                 throw KustvaktResponseHandler.throwit(e);
@@ -543,7 +543,7 @@
                                 .authenticate(0, oauthRequest.getUsername(),
                                         oauthRequest.getPassword(), attr);
                     Userdata data = controller
-                            .getUserData(user, Userdetails2.class);
+                            .getUserData(user, UserDetails.class);
                     user.addUserData(data);
 
                     attr.put(Attributes.CLIENT_SECRET,
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 03b19bc..b7a5e5e 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
@@ -213,7 +213,7 @@
         Scopes m;
         try {
             User user = controller.getUser(ctx.getUsername());
-            Userdata data = controller.getUserData(user, Userdetails2.class);
+            Userdata data = controller.getUserData(user, UserDetails.class);
 
             Set<String> base_scope = StringUtils.toSet(scopes, " ");
             if (scopes != null)
@@ -236,7 +236,7 @@
         String result;
         try {
             User user = controller.getUser(ctx.getUsername());
-            Userdata data = controller.getUserData(user, UserSettings2.class);
+            Userdata data = controller.getUserData(user, UserSettings.class);
             data.addField(Attributes.USERNAME, ctx.getUsername());
             result = data.data();
         }catch (KustvaktException e) {
@@ -262,14 +262,14 @@
             if (user.isDemo())
                 return Response.notModified().build();
 
-            Userdata data = controller.getUserData(user, UserSettings2.class);
+            Userdata data = controller.getUserData(user, UserSettings.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 UserSettings2(user.getId());
+            Userdata new_data = new UserSettings(user.getId());
             new_data.setData(JsonUtils.toJSON(settings));
             data.update(new_data);
 
@@ -292,7 +292,7 @@
         String result;
         try {
             User user = controller.getUser(ctx.getUsername());
-            Userdata data = controller.getUserData(user, Userdetails2.class);
+            Userdata data = controller.getUserData(user, UserDetails.class);
             data.addField(Attributes.USERNAME, ctx.getUsername());
             result = data.data();
         }catch (KustvaktException e) {
@@ -318,10 +318,10 @@
             if (user.isDemo())
                 return Response.notModified().build();
 
-            Userdetails2 new_data = new Userdetails2(user.getId());
+            UserDetails new_data = new UserDetails(user.getId());
             new_data.setData(JsonUtils.toJSON(wrapper));
 
-            Userdetails2 det = controller.getUserData(user, Userdetails2.class);
+            UserDetails det = controller.getUserData(user, UserDetails.class);
             det.update(new_data);
             controller.updateUserData(det);
         }catch (KustvaktException e) {
diff --git a/src/test/java/UserdataTest.java b/src/test/java/UserdataTest.java
index 1acd921..f8cd1b9 100644
--- a/src/test/java/UserdataTest.java
+++ b/src/test/java/UserdataTest.java
@@ -37,7 +37,7 @@
         user.setId(1);
         UserDetailsDao dao = new UserDetailsDao(
                 BeanConfiguration.getBeans().getPersistenceClient());
-        Userdetails2 d = new Userdetails2(1);
+        UserDetails d = new UserDetails(1);
         d.addField("key_1", "value is a value");
         assert dao.store(d) != -1;
     }
@@ -48,7 +48,7 @@
         user.setId(1);
         UserDetailsDao dao = new UserDetailsDao(
                 BeanConfiguration.getBeans().getPersistenceClient());
-        Userdetails2 d = new Userdetails2(1);
+        UserDetails d = new UserDetails(1);
         d.addField("key_1", "value is a value");
         assert dao.store(d) != -1;
 
@@ -63,7 +63,7 @@
 
     @Test
     public void testDataValidation() {
-        Userdata data = new Userdetails2(1);
+        Userdata data = new UserDetails(1);
         data.addField(Attributes.COUNTRY, "Germany");
 
         String[] req = data.requiredFields();
@@ -75,7 +75,7 @@
 
     @Test
     public void testSettingsValidation() {
-        Userdata data = new UserSettings2(1);
+        Userdata data = new UserSettings(1);
         data.addField(Attributes.FILE_FORMAT_FOR_EXPORT, "export");
 
         String[] req = data.requiredFields();
@@ -88,7 +88,7 @@
     @Test
     public void testUserdatafactory() throws KustvaktException {
         UserDataDbIface dao = UserdataFactory
-                .getDaoInstance(Userdetails2.class);
+                .getDaoInstance(UserDetails.class);
         assert UserDetailsDao.class.equals(dao.getClass());
     }
 
