Refactor Database model base class

Change-Id: I7b7bd03133a510e817377a6ae1df3454d5ffcb71