More nontrivial macro abstraction of state checks.