Refactor to DRY