Generalize window creation.