Extract a method of Window#init