Refactor unit tests for db info retrieval