Extract method refactor.