More elf code clean up