db abstraction and utility