Refactoring of Client class; tests do not run, yet.