moving DB fucntions to DB.hs.