It's about the same as most movie plots involving this sort of thing. In order to kill the immortal you have to do something to the magical McGuffin that keeps him immortal. After immortal is now, well, mortal, you kill them. In this case, it was their coding.