refactor check_state methods