refactor xaml