Refactor WindowContext.