Could combine these three if tests into one using and and or.