   [lines]
   (letfn [(deserialize [lines pre-start current-track]
             (lazy-seq
-             (when (some? (first lines))
-               (let [fields (-> lines first cstr/trim (cstr/split #"\s+"))]
+             (when-first [line lines]
+               (let [fields (-> line cstr/trim (cstr/split #"\s+"))]
                  (case (first fields)
                    ; declaration line of variableStep
                    "variableStep"


                             :fixed-step
                             (let [{:keys [chr start end]} (first track)
                                   step (- (-> track rest first :start) start)
                                   span (inc (- end start))
                                   declaration-line (->> (cond-> ["fixedStep"
                                                                  (str "chrom=" chr)

                    (- (:end wig) (:start wig)))))
          (serialize [wigs]
            (lazy-seq
             (when-first [wig wigs]
               (let [[track rest-wigs] (split-with (partial same-track? wig)
                                                   wigs)
                     track (case (-> track first :format)
                             :variable-step
