Refactor parse engine