Refactored the code, and enabled nicknames for users