Remake of the database layer to avoid doublettes in DB.