Combined if statements into one