Refactor using methods