refactor wpf tool