Cleanup Parser type

While trying to understand the parsing code, I have come up with this refactoring.

Hope you have some time to review it.

It compiles, all tests are passing and it seems to run fine on my catalogs.

Cheers