improve code structure

move window related stuff to its own unit

(0) -2 +2 +10 +30 tip

mercurial