optimize getPathFromNode