Cleaned up client.js a bit