Perhaps move all of the operations in this conditional to a separate method?  Not sure on this, up to you.