Refactoring client timeout