Refactor some code for a future change.