add improvements to build for window and mac.