tidied up the client a bit