Code refactoring for IFrameWindow.