Change if statements to improve readability