improvements on dbmanager. stable version
some major refactorin and cleanup