Refactor saveNodeList