commenting and cleaning client.js