REFACTOR to make it readable in my terms with clientListener and serverListener