Rewrite two if statements to improve readability

Change-Id: Icf9c7d7cc21f7551250cab482033721555c27030
Merge "Rewrite two if statements to improve readability"