Actually the nesting level here may even indicate that it's worth separating some of this code out into a function.