Refactored self.client to client