tiny change - collapse multiple if statements into one