refactoring: remove NameLeafList etc and add test