#46 refactoring Server module: now, handshake function