speed-up string manipulation