completed the refactoring of the dataset db

Change-Id: I49fd57fa88cb5e60cc7bfc525b8a2d655cad4f4f