What's the driver for this block of code changes?  Perhaps I'm missing something subtle, but it seems equivalent to the original code except that the `if not instance` below always gets run while in the original it only gets run in the case where it might matter (when `value` is not a `BaseColumn`).