How does Shakespeare transform the archetype from Genesis in this passage from hamlet

Tis given out that, sleeping in my orchard, A serpent stung me; so the whole ear of Denmark is by forged process of my death Rankly abused: but know, thou noble youth, The serpent that did sting thy fathers life Now wears his crown

How does Shakespeare transform the archetype from Genesis in this passage from hamlet Tis given out that sleeping in my orchard A serpent stung me so the whole class=