moving db stuff to own file"