Add unit test and cleanup _getNodeFromIds method