WindowManager code review