abstract out db interface