avoid wrong nodes
refactor key retrieval