separated next state logic into 2 separate processes required func