Refactor. Added ClientListener