code cleanup/winfixes