refactored Db into adaptor, to allow extension for other providers