WPF rewrite cleanup