Reordered conditional blocks for consistency.