Refactoring WindowContext