Generating strings improvement