simplifying if statements