Refactor predicates in state