refactored csv_controller