Refactoring for failing test on Windows