Updated db class