       (string/replace #"[^a-zA-Z-]" "")
       string/lower-case))
 
+
 (defn parse-tree
   "Given a path scan for md files, and return a list. If folder, recur."
   [path category]
   (let [json (atom [])]
-    (doseq [f (.listFiles (io/file path))]
+    (doseq [f (fs/list-dir path)]
       ;; This is ugly. Here to avoid mapping the static folder
-      (when-not (some #{(.getName f)} ["static"])
+      (when-not (some #{(fs/name f)} ["static"])
         (swap! json
                conj
-               (if (.isDirectory f)
-                 (let [cat-name (.getName f)
+               (if (fs/directory? f)
+                 (let [cat-name (fs/name f)
                        [new-cat new-path] (map #(str %1 "/" cat-name)
                                                [category path])]
                    (parse-tree new-path new-cat))
-                 (let [[title content] (split-title (slurp (.getPath f)))]
+                 (let [[title content] (split-title (slurp f))]
                    {:title title
-                    :last-modified (.lastModified f)
+                    :last-modified (fs/mod-time f)
                     :path (str category "/" (pathize title))
                     :text content})))))
     @json))
+
 
 (defn generate-wiki
   "Given a OS path it will explore the folder tree and write a json in path/out/"
   [path]
   (spit (str path "/out/markiki.json")
         (generate-string (flatten (parse-tree (str path "/src") "")) {:pretty true})))
+
 
 (defn generate-index
   "Writes the index.html in out/"

                     [title (str text "\n" line)])))
               ["" ""])))

(defn pathize
  "Takes a string, returns a trimmed down string only w/ alphabet and hyphens"
  [title]

        "Please refer to the repo for more information: https://github.com/ff-/markiki"]
       (string/join \newline)))


(defn exit
  "Exits with status leaving a message"
  [status msg]
  (println msg)
  (System/exit status))


(defn split-title
  "Separates the main title from a Markdown text - returns a vector [title text]"
