CSV object refactoring and code cleanup