Could you extract this conditional into a method with a descriptive name? Having glanced at the code it is not obvious what this piece does.