refactor parse errors