   # This gets deleted once we're fully on minim
   refractTransitions = children(refract, {element: 'transition'})
 
-  apiElements.findRecursive('transition').forEach((transition, transitionNo) ->
-    transitionNo = transitionNo.toValue()
+  apiElements.findRecursive('transition').forEach((transitionElement, transitionNoElement) ->
+    transitionNo = transitionNoElement.toValue()
 
     # This gets deleted once we're fully on minim
     refractTransition = refractTransitions[transitionNo]

#
# Returns an array of numbers, where indexes correspond to HTTP transactions
# within the transition and values represent the example numbers.
detectExampleNumbersPerTransaction = (transition) ->
  tempRefractTransition = apiElementsToRefract(transition)
  tempRefractHttpTransactions = children(tempRefractTransition, {element: 'httpTransaction'})

  detectTransactionExamples(tempRefractTransition)

      # of Dredd. There's a plan to migrate to so-called "transaction paths"
      # in the future (apiaryio/dredd#227), which won't use the concept
      # of transaction examples anymore.
      exampleNumbersPerTransaction = detectExampleNumbersPerTransaction(transitionElement)
      hasMoreExamples = Math.max(exampleNumbersPerTransaction...) > 1

      # Dredd supports only testing of the first request-response pair within
      # each transaction example. We iterate over available transactions and
      # skip those, which are not first within a particular example.
      exampleNo = 0
      transitionElement.transactions.forEach((httpTransactionElement, httpTransactionNoElement) ->
        httpTransactionNo = httpTransactionNoElement.toValue()
        httpTransactionExampleNo = exampleNumbersPerTransaction[httpTransactionNo]

        relevantTransaction =
          refract: refractHttpTransactions[httpTransactionNo]
          apiElements: httpTransactionElement
          exampleNo: if hasMoreExamples then httpTransactionExampleNo else null

        if httpTransactionExampleNo isnt exampleNo
          relevantTransactions.push(relevantTransaction)

        exampleNo = httpTransactionExampleNo
      )
    else
      # All other formats then API Blueprint
      transitionElement.transactions.forEach((httpTransactionElement, httpTransactionNoElement) ->
        relevantTransactions.push(
          refract: refractHttpTransactions[httpTransactionNoElement.toValue()]
          apiElements: httpTransactionElement
        )
      )
  )
