refactored out common methods into a parser_helper module