refactor into single db

Change-Id: Ic445754e7cbd8cd5eab24e46c7ea8a1d600521c2