Small client refactoring