move db fxns to their own file