Using factory constructor on parser