                        ((consp tend) (float-time tend))
                        (t tend)))
            task-clock-times times)
-      (db/org-map-clock-lines-and-entries
+      (timeline-tools-map-clock-lines-and-entries
        ;; when on clock line, collect times
        #'(lambda (start end)
            (let* ((ts (float-time

            ((and (<= current-start new-start new-end current-end))
             (beginning-of-line)
             (kill-line)
             (db/org-insert-clockline current-start new-start)
             (open-line 1)
             (db/org-insert-clockline new-end current-end))
            ;; New interval overlaps beginning of current line
            ((<= new-start current-start new-end current-end)
             (beginning-of-line)
             (kill-line)
             (db/org-insert-clockline new-end current-end))
            ;; New interval overlaps at end of current line
            ((<= current-start new-start current-end new-end)
             (beginning-of-line)
             (kill-line)
             (db/org-insert-clockline current-start new-start)))))

       ;; Keep headline as they are, i.e., do nothing
       (lambda ())))

    ;; Finally add the new clock line
    (org-with-point-at target-marker
      (db/org-add-clocking-time new-start new-end))))

(defun db/org-clock-lines-of-task (marker)
  "Return list of all clock lines of task under MARKER.

Each clock line is represented as a cons cell (START . END),

;; myself was more fun :)
;; XXX: Find actual org-mode functions that do the stuff we are doing here

(defun timeline-tools-clocklines-in-range (tstart tend)
  "Return tasks in current buffer between TSTART and TEND.

The resulting list consists of elements of the form
