Simplified two if statements.