refactored windows support