Cleaned up code.
Added helper class ClientConnection.