Refactoring Client class instantiation