Refactoring
Refactoring complete. Client-server handshaking working