refactor character repository