More client refactoring