Refactor Parser to use a TextReader