Minor refactoring in client