There's a lot of iterating over collections then calling `grep` that simply returns the current item, are they necessary, i.e. is this to prevent `null` items being passed around later on?

If necessary, would it be better to create a method like `compact` that did that and was called from all the iterators required? Alternatively could methods like `rmDir` be written so as to be null safe?