Refactored db.