Another extract function refactor.