trivial refactoring for char funcs