refactor parse