broke up db.php into its individual classes