Refactor to avoid passing parameters needlessly.