Revamp the timeout mechanism to rely on messages rather than magic variables