first round of windows refactoring