refactor the parser component