refactor string conversions