Attempt to fix XAML error + removed obsolete code