refactors csv clearing