Flattening if conditions