Cleaning the code

Mostly making the parser class look nicer.