Client code refactoring