WPF continued

minor optimizations