Refactored string gen.