Saving state before conversion to using relays