Refactored NICK handler