split control into two if's