Remove unecessary variable.
Properly clear window state.