helper function for "target-state"