Fix references for windows, minor refactoring due to andding stage object