refactor parse utility method