Refactor: remove duplication.