refactored stringmessage and client connection behaviour