Is there a reason these 3 if statements can't be collapsed into 1 statement?