Collapse nested if statements

Change-Id: I1cecfe5884edb98c8ad0a441f4d82288d597f631