Parser refactorings

A set of refactoring done to Parser.