move window creation to View class