This came straight from https://github.com/heroku/discussion/blob/master/app/models/username_generator.rb. I stopped trying to refactor and just used what they had to get it up and running.  I figure we can eventually factor this stuff out to an engine and contribute a gem back at some point.