out all db related methods into a class