refactoring to account for quoted table/field names
better refactoring to account for quoted table/field names