refactor, use ELFMAG/SELFMAG