Refractoring code in DBHelper and Model class