refactoring of adaptive timeouts