Refactory to build with WDK 7