Move database stuff to different file