move string transformations out of comprehension

slight micro-perf increase from fixing a dumb mistake