 (defun timeline-tools-entry-category (entry)
   "Return ARCHIVE_CATEGORY or CATEGORY at position given by MARKER.
 Return whatever is found first."
-  (let ((marker (car (timeline-tools-entry-markers entry))))
+  (let ((marker (timeline-tools-entry-marker entry)))
     (or (org-entry-get marker "ARCHIVE_CATEGORY")
         (org-entry-get marker "CATEGORY"))))
 
-(defun timeline-tools-entry-headlines (entry)
-  "Return list of all headlines associated with ENTRY.
+(defun timeline-tools-entry-headline (entry)
+  "Return the headline associated with ENTRY.
 The headline will be a string, propertized with a property called
 `marker’ and a corresponding marker pointing to the headline."
-  (mapcar (lambda (marker)
-            (let ((heading (org-with-point-at marker
-                             (org-element-headline-parser (point-max)))))
-              (propertize (plist-get (cadr heading) :raw-value)
-                          'marker marker)))
-          (timeline-tools-entry-markers entry)))
+  (let* ((marker (timeline-tools-entry-marker entry))
+         (heading (org-with-point-at marker
+                    (org-element-headline-parser (point-max)))))
+    (propertize (plist-get (cadr heading) :raw-value)
+                'marker marker)))
 
  

      (insert "|--|\n")
      (insert "| Category | Start | End | Duration | Task |\n")
      (let ((last-category nil))
        (dolist (cluster timeline)
          (when (not (equal last-category (timeline-tools-entry-category cluster)))
            (insert "|--|\n")
            (setq last-category (timeline-tools-entry-category cluster)))
          (insert (format "| %s | %s | %s | %s min | "
                           (timeline-tools-entry-category cluster)
                           (timeline-tools-format-entry-time cluster 'start)
                           (timeline-tools-format-entry-time cluster 'end)
                           (timeline-tools-entry-duration cluster)))
           ;; insert headline line by line
          (dolist (headline (-interpose "|\n |||||"
                                        (timeline-tools-entry-headlines cluster)))
            (insert headline))
          (insert "\n")))
      (insert "|--|\n")
      (org-table-align)
      (goto-char (point-min)))))

This only works if every entry in timeline consists of a
singleton marker only.  In case this is not satisfied, this
function will throw an error."
  (let ((new-timeline (-partition-by #'(lambda (entry)
                                         (timeline-tools-entry-marker entry))
                                     timeline)))
    (mapcar (lambda (cluster)
              (timeline-tools-make-entry
               (timeline-tools-entry-start-time (-first-item cluster))
               (timeline-tools-entry-end-time (-last-item cluster))
               (timeline-tools-entry-markers (-first-item cluster))))
            new-timeline)))

(defun timeline-tools-remove-short-entries (timeline &optional threshold)
