Can we split the logic here for all the if isinstances into a separate function which calls separate functions so that it's more manageable?  Example: https://github.com/ooici/coi-services/blob/master/ion/services/dm/utility/types.py#L88-L106