Refactor and rename parse method