I'm not sure why are you generating an elf with the payload, looks like it isn't used later, is it?