DRY code clean up - better encapsulation of db init threads and db
access functions.