Added DB::udpate() method, refactored DB class