unfinished emun_by_name refactoring