splitting out window creation method