Refactoring makeTable function to be database agnostic.