Refactor character class