Lots of refactoring of client class