created separate method for file reader