refactor some parsers