refactor node lookup