consolidated if statements