restructued db model