update DB helpers to use interfaces

this way the helpers can be mocked to test other parts of the code