refactored code for duplicate username is used for facebook, twitter. Or a Github account with an empty email address is used.