reusing some old code for building IAVMList