I would have put this in the nested if below because it is used only there.