Refactor character_repair