moved all db functions into root db package