seperate out database and util functionality