Refactored IO methods to use CSV class