added class db in root object
leaking far fewer implementation details
only typedef abstrat things