SocketHandler init and utils