cleanups in the window machinery