Code cleanup for windows