(minor optimization) getting the unverified bundle can be refactored out of here (it seems to be the same code here and below in the "else if" section.