Internal parser implementation refactor