OPEN - task #11: client: refactor as a class 
http://github.com/GustavePate/sandbox/issues/issue/11
restructred client