Minor refactoring in the client code