condense if statements