simplify / style-tweak conditionals in state.py