+tests +databaseService + refactoring