Refactored stringgenerator