refactored csv validation
added tests for csv validation