Refactored DBAdapter