make the conditions around stack creation easier to read