This nesting has gotten too deep, I think this should be extracted into a method.