Simplify and restructure code.
Update client.go
Merge pull request #1 from egonelbre/master

Simplify and restructure code.