some code cleaning in dbAdapter