refactored getTodoFromNode