Tweak adapter logic to check for instanceof