Moved db stuff to DbModel