Restructed the database