write rows to edn too. code cleanup