refactor get_one_state out of get_state