Refactor parse pattern.