little refactoring for timout mechanism