Refactor of random name generator