That is what I ended up doing, repeating the code. Very irritating, when there were only 3 lines that were different - total maintenance headache.
I guess what I was hoping for was to be able to populate some type of variable with either "tdf" or "qdf" along with their respective collection pointers so that my "For each.." statement would use variables previously populated with those values. I am sure there must be a way, just far above my expertise level!