ENH: add more general dynamic name resolution