Refactoring windows context class.