A bit saner template recursion and CSV output