Bug 988697: Refactoring code and sketching clearIdleTimeout