   (interactive)
   (unless (eq major-mode 'timeline-tools-mode)
     (user-error "Not in Timeline buffer"))
-  (let ((marker (save-mark-and-excursion
-                  (beginning-of-line)
-                  (org-table-next-field)
-                  (-> (get-text-property (point) 'entry)
-                      (timeline-tools-entry-marker)))))
-    (unless marker
-      (user-error "Not on headline to jump to"))
+  (let ((marker (timeline-tools-entry-marker (timeline-tools--get-entry-from-point))))
     (switch-to-buffer (marker-buffer marker))
     (goto-char marker)
     (org-reveal)))


  (let (pos-entry-1 pos-entry-2 entry-1 entry-2)

    ;; XXX: this feels redundant and should be refactored into a separate
    ;; function or something.
    (save-mark-and-excursion
      ;; Get first entry and its position.
      (beginning-of-line)
      (unless (looking-at "^| ")
        (user-error "Not in table"))
      (org-table-next-field)
      (setq entry-1 (get-text-property (point) 'entry)
            pos-entry-1 (point))
      (unless entry-1
        (user-error "Not on valid row in timeline"))

      ;; If there's no next line, the following will barf.
      (timeline-tools-next-line)

      (beginning-of-line)
      (org-table-next-field)
      (setq entry-2 (get-text-property (point) 'entry)
            pos-entry-2 (point))
      (unless entry-2
        (user-error "Next row not valid in timeline")))

    ;; Let's create new entries and overwrite the old ones.


      (goto-char (point-min))
      (timeline-tools-next-line))))

(defun timeline-tools--get-entry-from-point ()
  "Return timeline entry of point when in timeline buffer."
  (unless (derived-mode-p 'timeline-tools-mode))
  (save-mark-and-excursion
    (unless (org-at-table-p)
      (user-error "Not in table"))
    (unless (looking-at "^| ")
      (user-error "Not on valid row in timeline"))
    (beginning-of-line)
    (org-table-next-field)
    (if-let ((entry (get-text-property (point) 'entry)))
        entry
      (user-error "Not on valid row in timeline"))))

(defun timeline-tools-next-line ()
  "Move point to next line in timetable, if possible."
  (interactive)
