So it seems like we're using some superfluous assignments/variables here. How about this:

```scala
  if (theListOfBoxes.exists { case _: Failure => true }) {
    Failure(failureErrorMessage) ~> theListOfBoxes
  } else {
    theListOfBoxes.flatten
  }
```

Also, do we want to call out the fact that the length of the incoming list and the length of
the outgoing list may not be equal if there are `Empty` entries?