Refactoring code, adding unregister command, ensuring client name unique