Refactor away duplication.