Moved window managing to WindowMgr class