Refactored parser to use FileReader to read input file.