Many bug fixed

refactoring
WPF proxy bug fixed