Modularized the window creation a bit