Refactorings, enabling csv output