Database helper class rewrite and reimplementation in MainActivity.