This if statement seems like it has gotten out of hand.