Added sample client program (example)

- Small refactoring on the client