complex changes to the db component: a lot of new methods, refactoring