refactoring of string conversion mechanism