Put string generation into UserData so that code can be reused