Code cleanup for WinStore and WinDesktop. To ensure samples have minimal difference.