Db-class refactoring