various optimizations for flattening and joining 2 strings