Refactor client class