Refactored module dbHandler so it can work with the refactored db module