updated db handling and docs