Multiline if statements and simplify 1 test