Split method into two if branches