refactored using the CSV class