  o Code simplification and refactoring:
    - Refactor some common node selection code into a single function.
      Closes ticket 34200.
