Minor rearrangement for convenience.