Refactored Parser to return a Result object