Cleaned up and commented the WindowManager.