simplify state check