refactor debugging portion of parser.
refactor.