Refactored nonce checker