Simplify and fix for WINRT