From 1b12aa36a348a15762ee4f7521eb260be5846685 Mon Sep 17 00:00:00 2001
From: Michael Krisper <michael.krisper@tugraz.at>
Date: Tue, 15 Feb 2022 12:10:21 +0100
Subject: [PATCH] Removed Castle.Core Library. It was not needed.

---
 VECTO/Input Files/Vehicle.vb                  |  1 -
 .../Helper/Converter/EnumConverter.cs         |  8 +-----
 VECTO3GUI2020/Helper/FileHelper.cs            |  3 +--
 VECTO3GUI2020/Helper/NameResolver.cs          |  4 +--
 VECTO3GUI2020/Helper/XMLExtension.cs          |  3 ---
 VECTO3GUI2020/Helper/XmlHelper.cs             |  7 ++---
 .../UseFirstArgumentAsNameInstanceProvider.cs |  3 +--
 VECTO3GUI2020/TestViewModel.cs                | 12 +--------
 .../ComponentWriter/XMLAirDragWriter.cs       |  7 +----
 .../XMLBusAuxiliariesWriter.cs                |  4 +--
 .../ComponentWriter/XMLVehicleWriter.cs       |  3 +--
 VECTO3GUI2020/Util/XML/XMLNamespaces.cs       |  9 ++-----
 VECTO3GUI2020/VECTO3GUI2020.csproj            |  9 +------
 .../Implementation/JobListViewModel.cs        |  6 +----
 .../Implementation/MainWindowViewModel.cs     |  4 ---
 .../Implementation/CreateVifViewModel.cs      |  6 -----
 .../InterimStageBusVehicleViewModel_v2_8.cs   | 19 +++-----------
 .../MultistageAuxiliariesViewModel.cs         | 11 +-------
 .../MultistageJobViewModel_v0_1.cs            | 26 ++++---------------
 .../Implementation/StageViewModelBase.cs      |  7 ++---
 .../VectoAuxiliariesTests.vbproj              |  1 -
 .../HelperTests/BackingStorageTest.cs         |  4 ---
 .../ViewModelTests/ExemptedTests.cs           |  2 --
 .../ViewModelTests/LoadAndSaveVehicleData.cs  | 23 +++-------------
 .../ViewModelTests/VehicleViewModelTests.cs   | 17 +++---------
 .../XMLDeclarationVehicleDataProvider.cs      |  5 +---
 ...ricMachinesDeclarationInputDataProvider.cs |  3 +--
 ...ectricMotorDeclarationInputDataProvider.cs |  9 +++----
 .../XMLDeclarationMultistageInputReader.cs    |  7 ++---
 .../OutputData/FileIO/TempFileOutputWriter.cs |  5 +---
 .../DeclarationJobs/XMLCompletedBusWriter.cs  |  9 ++-----
 .../CompletedBusDimensionsWriter.cs           |  8 +-----
 .../CompletedBusGeneralParametersWriter.cs    |  9 +------
 .../CompletedBusParametersWriter.cs           |  7 +----
 .../CompletedBusPassengerCountWriter.cs       |  8 +-----
 .../BusAuxElectricSystemLightsGroupWriter.cs  |  8 +-----
 .../BusAuxElectricSystemSupplyGroupWriter.cs  |  6 -----
 .../BusAuxHVACConventionalGroupWriter.cs      |  7 +----
 .../Auxiliaries/BusAuxHVACHeatPumpWriter.cs   |  8 +-----
 .../OutputData/XML/GroupWriter/GroupWriter.cs |  6 +----
 VectoCore/VectoCore/Utils/PathHelper.cs       |  5 ++--
 VectoCore/VectoCore/Utils/XMLHelper.cs        |  3 +--
 VectoCore/VectoCoreTest/VectoCoreTest.csproj  |  1 -
 43 files changed, 55 insertions(+), 258 deletions(-)

diff --git a/VECTO/Input Files/Vehicle.vb b/VECTO/Input Files/Vehicle.vb
index 70aaab2ba7..a84b744a4a 100644
--- a/VECTO/Input Files/Vehicle.vb	
+++ b/VECTO/Input Files/Vehicle.vb	
@@ -14,7 +14,6 @@ Imports System.Collections.Generic
 Imports System.ComponentModel.DataAnnotations
 Imports System.IO
 Imports System.Linq
-Imports System.Runtime.Remoting.Messaging
 Imports System.Xml
 Imports TUGraz.VECTO.Input_Files
 Imports TUGraz.VectoCommon.BusAuxiliaries
diff --git a/VECTO3GUI2020/Helper/Converter/EnumConverter.cs b/VECTO3GUI2020/Helper/Converter/EnumConverter.cs
index d5e4590621..12dffc1f3c 100644
--- a/VECTO3GUI2020/Helper/Converter/EnumConverter.cs
+++ b/VECTO3GUI2020/Helper/Converter/EnumConverter.cs
@@ -1,12 +1,7 @@
 using System;
-using System.Collections.Generic;
 using System.Globalization;
 using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows;
 using System.Windows.Data;
-using Castle.Core.Internal;
 using TUGraz.VectoCommon.Utils;
 
 namespace VECTO3GUI2020.Helper.Converter
@@ -27,8 +22,7 @@ namespace VECTO3GUI2020.Helper.Converter
 			var attributes =
 				valueType.GetField(value.ToString())?.GetCustomAttributes( typeof(GuiLabelAttribute),false);
 
-			GuiLabelAttribute attribute = attributes.IsNullOrEmpty() ? null : attributes.First() as GuiLabelAttribute;
-			if (attribute == null) {
+			if (!(attributes?.First() is GuiLabelAttribute attribute)) {
 				return value;
 			} else {
 				return attribute.Label;
diff --git a/VECTO3GUI2020/Helper/FileHelper.cs b/VECTO3GUI2020/Helper/FileHelper.cs
index 3cad81f509..8f5e688856 100644
--- a/VECTO3GUI2020/Helper/FileHelper.cs
+++ b/VECTO3GUI2020/Helper/FileHelper.cs
@@ -1,5 +1,4 @@
 using System.IO;
-using Castle.Core.Internal;
 
 namespace VECTO3GUI2020.Helper
 {
@@ -8,7 +7,7 @@ namespace VECTO3GUI2020.Helper
 		public static void CreateDirectory(string fileName)
 		{
 			var dirName = Path.GetDirectoryName(fileName);
-			if (!dirName.IsNullOrEmpty()) {
+			if (!string.IsNullOrEmpty(dirName)) {
 				Directory.CreateDirectory(dirName);
 			}
 		}
diff --git a/VECTO3GUI2020/Helper/NameResolver.cs b/VECTO3GUI2020/Helper/NameResolver.cs
index 45864264e1..9191c69408 100644
--- a/VECTO3GUI2020/Helper/NameResolver.cs
+++ b/VECTO3GUI2020/Helper/NameResolver.cs
@@ -1,5 +1,4 @@
 using System.Resources;
-using Castle.Core.Internal;
 
 namespace VECTO3GUI2020.Helper
 {
@@ -10,10 +9,9 @@ namespace VECTO3GUI2020.Helper
 			foreach (var resourceManager in resourceManagers)
 			{
 				var resolvedName = resourceManager?.GetString(propertyName);
-				if (!resolvedName.IsNullOrEmpty())
+				if (!string.IsNullOrEmpty(resolvedName))
 				{
 					return resolvedName;
-					break;
 				}
 			}
 
diff --git a/VECTO3GUI2020/Helper/XMLExtension.cs b/VECTO3GUI2020/Helper/XMLExtension.cs
index 921b9711e9..c8f11753b6 100644
--- a/VECTO3GUI2020/Helper/XMLExtension.cs
+++ b/VECTO3GUI2020/Helper/XMLExtension.cs
@@ -1,10 +1,7 @@
 using System;
-using System.Diagnostics;
-using System.Windows.Forms;
 using System.Xml;
 using System.Xml.Linq;
 using System.Xml.Schema;
-using Castle.Core.Resource;
 using TUGraz.VectoCommon.InputData;
 using TUGraz.VectoCommon.Resources;
 using TUGraz.VectoCore.Utils;
diff --git a/VECTO3GUI2020/Helper/XmlHelper.cs b/VECTO3GUI2020/Helper/XmlHelper.cs
index 872ad97935..af8abe92b4 100644
--- a/VECTO3GUI2020/Helper/XmlHelper.cs
+++ b/VECTO3GUI2020/Helper/XmlHelper.cs
@@ -1,11 +1,9 @@
 using System;
 using System.Collections.Generic;
 using System.Diagnostics;
-using System.Linq;
 using System.Xml;
 using System.Xml.Linq;
 using System.Xml.Schema;
-using Castle.Core.Internal;
 using TUGraz.VectoCommon.Exceptions;
 using TUGraz.VectoCommon.Resources;
 using TUGraz.VectoCore.Utils;
@@ -18,11 +16,10 @@ namespace VECTO3GUI2020.Helper
 	{
 		public static XmlDocument ReadXmlDocument(string filePath)
 		{
-			if (filePath.IsNullOrEmpty())
+			if (string.IsNullOrEmpty(filePath))
 				return null;
 
 			var xmlDocument = new XmlDocument();
-			
 				
 			xmlDocument.Load(filePath);	
 
@@ -32,7 +29,7 @@ namespace VECTO3GUI2020.Helper
 
 		public static XmlNodeList GetComponentNodes(XmlDocument xmlDocument, string parentNode, string nodeName)
 		{
-			if (xmlDocument == null || parentNode.IsNullOrEmpty() || nodeName.IsNullOrEmpty())
+			if (xmlDocument == null || string.IsNullOrEmpty(parentNode) || string.IsNullOrEmpty(nodeName))
 				return null;
 
 			return xmlDocument.SelectNodes($"//*[local-name()='{parentNode}']//*[local-name()='{nodeName}']");
diff --git a/VECTO3GUI2020/Ninject/Util/UseFirstArgumentAsNameInstanceProvider.cs b/VECTO3GUI2020/Ninject/Util/UseFirstArgumentAsNameInstanceProvider.cs
index 97c89dbee4..3280e14506 100644
--- a/VECTO3GUI2020/Ninject/Util/UseFirstArgumentAsNameInstanceProvider.cs
+++ b/VECTO3GUI2020/Ninject/Util/UseFirstArgumentAsNameInstanceProvider.cs
@@ -50,8 +50,7 @@ namespace VECTO3GUI2020.Ninject.Util
             catch (Exception e)
             {
                 throw new VectoException("failed to create instance for '{1}' via '{0}' version '{2}'", e, methodInfo.Name, methodInfo.ReturnType.Name, arguments[0]);
-                throw e;
-            }
+			}
         }
     }
 }
diff --git a/VECTO3GUI2020/TestViewModel.cs b/VECTO3GUI2020/TestViewModel.cs
index a21deb9371..8b0677c0c3 100644
--- a/VECTO3GUI2020/TestViewModel.cs
+++ b/VECTO3GUI2020/TestViewModel.cs
@@ -1,18 +1,8 @@
 using System;
-using System.CodeDom;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using Castle.Components.DictionaryAdapter;
-using Castle.Core.Internal;
-using TUGraz.VectoCommon.BusAuxiliaries;
 using TUGraz.VectoCommon.Utils;
 using VECTO3GUI2020.Helper;
 using VECTO3GUI2020.ViewModel.Implementation.Common;
 using VECTO3GUI2020.ViewModel.Interfaces;
-using VECTO3GUI2020.ViewModel.Interfaces.Common;
 
 namespace VECTO3GUI2020
 {
@@ -77,7 +67,7 @@ namespace VECTO3GUI2020
 			get => _testString;
 			set
 			{
-				if (value.IsNullOrEmpty()) {
+				if (string.IsNullOrEmpty(value)) {
 					throw new VectoEmptyFieldException();
 				}
 				SetProperty(ref _testString, value);
diff --git a/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLAirDragWriter.cs b/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLAirDragWriter.cs
index aaeaa4fa37..07e369e7a6 100644
--- a/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLAirDragWriter.cs
+++ b/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLAirDragWriter.cs
@@ -1,13 +1,8 @@
 using System;
-using System.Collections.Generic;
 using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
 using System.Xml.Linq;
-using Castle.Core.Internal;
 using TUGraz.VectoCommon.InputData;
 using TUGraz.VectoCommon.Resources;
-using TUGraz.VectoCore.InputData.FileIO.XML.Engineering.Interfaces;
 using VECTO3GUI2020.Helper;
 using VECTO3GUI2020.Util.XML.Interfaces;
 using VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components;
@@ -80,7 +75,7 @@ namespace VECTO3GUI2020.Util.XML.Implementation.ComponentWriter
 			dataElement.Add(new XElement(_defaultNamespace + XMLNames.AirDrag_DeclaredCdxA, _inputData.AirDragArea.ToXMLFormat(2)));
 
 
-			dataElement.DescendantsAndSelf().Where(e => e.Value.IsNullOrEmpty()).Remove();
+			dataElement.DescendantsAndSelf().Where(e => string.IsNullOrEmpty(e.Value)).Remove();
 		}
 
 		protected override void Initialize()
diff --git a/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLBusAuxiliariesWriter.cs b/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLBusAuxiliariesWriter.cs
index 6bcc12e4bf..57b1a4ba9b 100644
--- a/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLBusAuxiliariesWriter.cs
+++ b/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLBusAuxiliariesWriter.cs
@@ -1,6 +1,6 @@
 using System.Linq;
 using System.Xml.Linq;
-using Castle.Core.Internal;
+
 using TUGraz.VectoCommon.BusAuxiliaries;
 using TUGraz.VectoCommon.InputData;
 using TUGraz.VectoCommon.Resources;
@@ -120,7 +120,7 @@ namespace VECTO3GUI2020.Util.XML.Implementation.ComponentWriter
 				dataElement.Add(hvacElement);
 			}
 
-			dataElement.DescendantsAndSelf().Where(e => e.Value.IsNullOrEmpty()).Remove();
+			dataElement.DescendantsAndSelf().Where(e => string.IsNullOrEmpty(e.Value)).Remove();
 		}
 
 		private void CreateElementsWithGroupWriters()
diff --git a/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLVehicleWriter.cs b/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLVehicleWriter.cs
index 7dd3ad3890..43fd5a161c 100644
--- a/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLVehicleWriter.cs
+++ b/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLVehicleWriter.cs
@@ -2,7 +2,6 @@
 using System.Diagnostics;
 using System.Linq;
 using System.Xml.Linq;
-using Castle.Core.Internal;
 using TUGraz.VectoCommon.BusAuxiliaries;
 using TUGraz.VectoCommon.InputData;
 using TUGraz.VectoCommon.Models;
@@ -302,7 +301,7 @@ namespace VECTO3GUI2020.Util.XML.Implementation.ComponentWriter
 					_inputData.ADAS.PredictiveCruiseControl.ToXMLFormat()));
 				aDASElement.Add(new XElement(adasNamespace + XMLNames.Vehicle_ADAS_ATEcoRollReleaseLockupClutch, _inputData.ADAS?.ATEcoRollReleaseLockupClutch ));
 			}
-			_Xelement.DescendantsAndSelf().Where(e => e.Value.IsNullOrEmpty()).Remove();
+			_Xelement.DescendantsAndSelf().Where(e => string.IsNullOrEmpty(e.Value)).Remove();
 
 			if (_inputData.Components != null) {
 				var componentElement = new XElement(
diff --git a/VECTO3GUI2020/Util/XML/XMLNamespaces.cs b/VECTO3GUI2020/Util/XML/XMLNamespaces.cs
index 174d4718ae..c0053b0d80 100644
--- a/VECTO3GUI2020/Util/XML/XMLNamespaces.cs
+++ b/VECTO3GUI2020/Util/XML/XMLNamespaces.cs
@@ -1,10 +1,5 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+using System.Collections.Generic;
 using System.Xml.Linq;
-using Castle.Core.Internal;
 
 namespace VECTO3GUI2020.Util.XML
 {
@@ -47,7 +42,7 @@ namespace VECTO3GUI2020.Util.XML
 
 		public static string GetPrefix(XNamespace xNamespace)
 		{
-			if (xNamespace.NamespaceName.IsNullOrEmpty()) {
+			if (string.IsNullOrEmpty(xNamespace.NamespaceName)) {
 				return null;
 			}
 			string prefix = NamespacePrefix[xNamespace];
diff --git a/VECTO3GUI2020/VECTO3GUI2020.csproj b/VECTO3GUI2020/VECTO3GUI2020.csproj
index 7656b72827..f71f1d540e 100644
--- a/VECTO3GUI2020/VECTO3GUI2020.csproj
+++ b/VECTO3GUI2020/VECTO3GUI2020.csproj
@@ -20,8 +20,7 @@
   </ItemGroup>
 
   <ItemGroup>
-    <PackageReference Include="Castle.Core" Version="4.4.1" />
-    <PackageReference Include="InteractiveDataDisplay.WPF" Version="1.0.0" />
+   <PackageReference Include="InteractiveDataDisplay.WPF" Version="1.0.0" />
     <PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="6.0.0" />
     <PackageReference Include="Microsoft.Maps.MapControl.WPF" Version="1.0.0.3" />
     <PackageReference Include="Microsoft.Toolkit.Mvvm" Version="7.1.2" />
@@ -35,12 +34,6 @@
     <PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="6.0.0" />
   </ItemGroup>
 
-  <ItemGroup>
-    <Reference Include="System.Windows.Controls.DataVisualization.Toolkit, Version=4.0.0.0, Culture=neutral, processorArchitecture=MSIL">
-      <HintPath>..\packages\System.Windows.Controls.DataVisualization.Toolkit.4.0.0.0\lib\net40-Client\System.Windows.Controls.DataVisualization.Toolkit.dll</HintPath>
-    </Reference>
-  </ItemGroup>
-
   <ItemGroup>
     <Compile Update="Behaviours\AutoScrollDataGridBehaviour.cs" />
     <Compile Update="Behaviours\PopUpHorizontalAlignmentBehavior.cs" />
diff --git a/VECTO3GUI2020/ViewModel/Implementation/JobListViewModel.cs b/VECTO3GUI2020/ViewModel/Implementation/JobListViewModel.cs
index 5ee05781a8..480523a635 100644
--- a/VECTO3GUI2020/ViewModel/Implementation/JobListViewModel.cs
+++ b/VECTO3GUI2020/ViewModel/Implementation/JobListViewModel.cs
@@ -9,11 +9,9 @@ using System.Threading;
 using System.Threading.Tasks;
 using System.Windows;
 using System.Windows.Data;
-using System.Windows.Forms.VisualStyles;
 using System.Windows.Input;
 using System.Xml;
 using System.Xml.Linq;
-using Castle.Core.Internal;
 using Microsoft.Toolkit.Mvvm.Input;
 using Newtonsoft.Json;
 using NLog;
@@ -22,7 +20,6 @@ using TUGraz.VectoCommon.Exceptions;
 using TUGraz.VectoCommon.InputData;
 using TUGraz.VectoCommon.Models;
 using TUGraz.VectoCommon.Resources;
-using TUGraz.VectoCommon.Utils;
 using TUGraz.VectoCore.Configuration;
 using TUGraz.VectoCore.InputData.FileIO.JSON;
 using TUGraz.VectoCore.InputData.FileIO.XML;
@@ -30,7 +27,6 @@ using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider;
 using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Interfaces;
 using TUGraz.VectoCore.Models.Simulation;
 using TUGraz.VectoCore.Models.Simulation.Impl;
-using TUGraz.VectoCore.Models.Simulation.Impl.SimulatorFactory;
 using TUGraz.VectoCore.OutputData;
 using TUGraz.VectoCore.OutputData.FileIO;
 using TUGraz.VectoCore.Utils;
@@ -674,7 +670,7 @@ namespace VECTO3GUI2020.ViewModel.Implementation
 			var sortedOutputWriters = outputWriters.OrderBy(ow => ow.JobFile);
 			foreach (var outputDataWriter in sortedOutputWriters) {
 				var writtenFiles = outputDataWriter.GetWrittenFiles();
-				if (writtenFiles.IsNullOrEmpty()) {
+				if (writtenFiles is null || writtenFiles.Count == 0) {
 					continue;
 				}
 				var jobFileName = outputDataWriter.JobFile;
diff --git a/VECTO3GUI2020/ViewModel/Implementation/MainWindowViewModel.cs b/VECTO3GUI2020/ViewModel/Implementation/MainWindowViewModel.cs
index 9454c8c3a3..c14355c9be 100644
--- a/VECTO3GUI2020/ViewModel/Implementation/MainWindowViewModel.cs
+++ b/VECTO3GUI2020/ViewModel/Implementation/MainWindowViewModel.cs
@@ -1,15 +1,11 @@
 using System;
 using System.Collections.Generic;
 using VECTO3GUI2020.ViewModel.Interfaces;
-using Ninject;
-using System.Diagnostics;
 using System.Windows.Input;
-using Castle.DynamicProxy.Generators.Emitters.SimpleAST;
 using System.Reflection;
 using VECTO3GUI2020.Helper;
 using VECTO3GUI2020.ViewModel.Implementation.Common;
 using VECTO3GUI2020.Util;
-using VECTO3GUI2020.Views;
 
 namespace VECTO3GUI2020.ViewModel.Implementation
 {
diff --git a/VECTO3GUI2020/ViewModel/MultiStage/Implementation/CreateVifViewModel.cs b/VECTO3GUI2020/ViewModel/MultiStage/Implementation/CreateVifViewModel.cs
index 1d41ef524e..bb6775d561 100644
--- a/VECTO3GUI2020/ViewModel/MultiStage/Implementation/CreateVifViewModel.cs
+++ b/VECTO3GUI2020/ViewModel/MultiStage/Implementation/CreateVifViewModel.cs
@@ -5,18 +5,13 @@ using System.IO;
 using System.Text;
 using System.Windows;
 using System.Windows.Input;
-using Castle.Core.Internal;
-using InteractiveDataDisplay.WPF;
 using Microsoft.Toolkit.Mvvm.Input;
-using Microsoft.WindowsAPICodePack.Shell.Interop;
 using Newtonsoft.Json;
 using TUGraz.VectoCommon.Exceptions;
 using TUGraz.VectoCommon.InputData;
 using TUGraz.VectoCommon.Models;
 using TUGraz.VectoCore.InputData.FileIO.JSON;
 using TUGraz.VectoCore.InputData.FileIO.XML;
-using TUGraz.VectoCore.InputData.FileIO.XML.Declaration;
-using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider;
 using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider.v24;
 using TUGraz.VectoCore.Utils;
 using VECTO3GUI2020.Helper;
@@ -24,7 +19,6 @@ using VECTO3GUI2020.Model.Multistage;
 using VECTO3GUI2020.ViewModel.Implementation.Common;
 using VECTO3GUI2020.ViewModel.Interfaces;
 using VECTO3GUI2020.ViewModel.Interfaces.Document;
-using Delegate = System.Delegate;
 
 namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation
 {
diff --git a/VECTO3GUI2020/ViewModel/MultiStage/Implementation/InterimStageBusVehicleViewModel_v2_8.cs b/VECTO3GUI2020/ViewModel/MultiStage/Implementation/InterimStageBusVehicleViewModel_v2_8.cs
index d824dbb9b4..b71ee96756 100644
--- a/VECTO3GUI2020/ViewModel/MultiStage/Implementation/InterimStageBusVehicleViewModel_v2_8.cs
+++ b/VECTO3GUI2020/ViewModel/MultiStage/Implementation/InterimStageBusVehicleViewModel_v2_8.cs
@@ -6,25 +6,18 @@ using System.Diagnostics;
 using System.Resources;
 using System.Runtime.CompilerServices;
 using System.Xml;
-using Castle.Core.Internal;
 using TUGraz.VectoCommon.BusAuxiliaries;
 using TUGraz.VectoCommon.Exceptions;
 using TUGraz.VectoCommon.InputData;
 using TUGraz.VectoCommon.Models;
 using TUGraz.VectoCommon.Utils;
-using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider;
 using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider.v24;
-using TUGraz.VectoCore.Models.Declaration;
 using VECTO3GUI2020.Helper;
-using VECTO3GUI2020.Ninject;
 using VECTO3GUI2020.Properties;
 using VECTO3GUI2020.ViewModel.Implementation.Common;
 using VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle;
 using VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle.Components;
-using VECTO3GUI2020.ViewModel.MultiStage.Implementation;
 using VECTO3GUI2020.ViewModel.MultiStage.Interfaces;
-using VECTO3GUI2020.Views.Multistage.CustomControls;
-using Convert = System.Convert;
 using EnumHelper = VECTO3GUI2020.Helper.EnumHelper;
 
 namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation
@@ -1227,14 +1220,10 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation
 		{
 			get => String.Join(",", Errors.Values);
 		}
-		public bool HasErrors
-		{
-			get
-			{
-				return !Error.IsNullOrEmpty() || 
-						(MultistageAuxiliariesViewModel != null && MultistageAuxiliariesViewModel.HasErrors);
-			}
-		}
+		public bool HasErrors =>
+			!string.IsNullOrEmpty(Error) || 
+			(MultistageAuxiliariesViewModel != null && MultistageAuxiliariesViewModel.HasErrors);
+
 		#endregion
 
 		private bool _airdragModifiedMultistepMandatory;
diff --git a/VECTO3GUI2020/ViewModel/MultiStage/Implementation/MultistageAuxiliariesViewModel.cs b/VECTO3GUI2020/ViewModel/MultiStage/Implementation/MultistageAuxiliariesViewModel.cs
index 16267be61d..4093dcb66c 100644
--- a/VECTO3GUI2020/ViewModel/MultiStage/Implementation/MultistageAuxiliariesViewModel.cs
+++ b/VECTO3GUI2020/ViewModel/MultiStage/Implementation/MultistageAuxiliariesViewModel.cs
@@ -6,7 +6,6 @@ using System.Diagnostics;
 using System.Resources;
 using System.Runtime.CompilerServices;
 using System.Xml;
-using Castle.Core.Internal;
 using TUGraz.VectoCommon.BusAuxiliaries;
 using TUGraz.VectoCommon.InputData;
 using TUGraz.VectoCommon.Models;
@@ -666,15 +665,7 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation
 			}
 		}
 
-		public bool HasErrors
-		{
-			get
-			{
-				var auxVmHasErrors = !Error.IsNullOrEmpty();
-
-				return auxVmHasErrors;
-			}
-		}
+		public bool HasErrors => !string.IsNullOrEmpty(Error);
 
 		public Dictionary<string, MultistageParameterViewModel> ParameterViewModels
 		{
diff --git a/VECTO3GUI2020/ViewModel/MultiStage/Implementation/MultistageJobViewModel_v0_1.cs b/VECTO3GUI2020/ViewModel/MultiStage/Implementation/MultistageJobViewModel_v0_1.cs
index 32ac07cef1..cab099207f 100644
--- a/VECTO3GUI2020/ViewModel/MultiStage/Implementation/MultistageJobViewModel_v0_1.cs
+++ b/VECTO3GUI2020/ViewModel/MultiStage/Implementation/MultistageJobViewModel_v0_1.cs
@@ -1,43 +1,29 @@
 using System;
-using System.CodeDom;
 using System.Collections.Generic;
 using System.ComponentModel;
 using System.Diagnostics;
 using System.IO;
 using System.Linq;
-using System.Resources;
-using System.Runtime.CompilerServices;
-using System.Text;
 using System.Windows;
-using System.Windows.Forms;
 using System.Windows.Input;
-using System.Windows.Navigation;
-using System.Xml;
 using System.Xml.Linq;
-using Castle.Core.Internal;
 using TUGraz.VectoCommon.InputData;
 using TUGraz.VectoCommon.Models;
-using TUGraz.VectoCore.InputData.FileIO.JSON;
 using TUGraz.VectoCore.InputData.FileIO.XML;
 using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider;
 using TUGraz.VectoCore.Models.Simulation;
 using TUGraz.VectoCore.Models.Simulation.Data;
 using TUGraz.VectoCore.Models.Simulation.Impl;
-using TUGraz.VectoCore.Models.Simulation.Impl.SimulatorFactory;
 using TUGraz.VectoCore.OutputData;
 using TUGraz.VectoCore.OutputData.FileIO;
 using TUGraz.VectoCore.Utils;
 using VECTO3GUI2020.Helper;
-using VECTO3GUI2020.Helper.Converter;
 using VECTO3GUI2020.Ninject;
 using VECTO3GUI2020.Properties;
 using VECTO3GUI2020.Util;
-using VECTO3GUI2020.Util.XML;
 using VECTO3GUI2020.ViewModel.Implementation.Common;
 using VECTO3GUI2020.ViewModel.Interfaces;
-using VECTO3GUI2020.ViewModel.Interfaces.Common;
 using VECTO3GUI2020.ViewModel.Interfaces.Document;
-using VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle;
 using VECTO3GUI2020.ViewModel.MultiStage.Interfaces;
 using INotifyPropertyChanged = System.ComponentModel.INotifyPropertyChanged;
 using XmlDocumentType = TUGraz.VectoCore.Utils.XmlDocumentType;
@@ -157,7 +143,7 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation
 
 							var auxiliariesErrorInfo =
 								vehicleViewModel.MultistageAuxiliariesViewModel as IDataErrorInfo;
-							if (auxiliariesErrorInfo != null && !auxiliariesErrorInfo.Error.IsNullOrEmpty()) {
+							if (auxiliariesErrorInfo != null && !string.IsNullOrEmpty(auxiliariesErrorInfo.Error)) {
 								errorMessage += "Auxiliaries\n";
 								errorMessage += auxiliariesErrorInfo.Error.Replace(",", "\n");
 							}
@@ -363,12 +349,10 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation
 			set => SetProperty(ref _selected, value);
 		}
 
-		public bool CanBeSimulated
-		{
-			get
-			{
-				return (InputComplete && _inputData.JobInputData.ConsolidateManufacturingStage.Vehicle.VehicleDeclarationType ==
-					VehicleDeclarationType.final) || (InputComplete && Exempted);
+		public bool CanBeSimulated {
+			get {
+				var declType = _inputData.JobInputData.ConsolidateManufacturingStage.Vehicle.VehicleDeclarationType;
+				return InputComplete && (declType == VehicleDeclarationType.final || Exempted);
 			}
 			set => throw new NotImplementedException();
 		}
diff --git a/VECTO3GUI2020/ViewModel/MultiStage/Implementation/StageViewModelBase.cs b/VECTO3GUI2020/ViewModel/MultiStage/Implementation/StageViewModelBase.cs
index 3bb13847a8..137647f0f4 100644
--- a/VECTO3GUI2020/ViewModel/MultiStage/Implementation/StageViewModelBase.cs
+++ b/VECTO3GUI2020/ViewModel/MultiStage/Implementation/StageViewModelBase.cs
@@ -6,7 +6,6 @@ using System.IO;
 using System.Windows;
 using System.Windows.Input;
 using System.Xml.Linq;
-using Castle.Core.Internal;
 using Microsoft.Toolkit.Mvvm.Input;
 using Ninject;
 using TUGraz.VectoCommon.InputData;
@@ -159,10 +158,8 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation
 				errorMessage += vehicleErrorInfo.Error.Replace(",", "\n");
 
 
-				var auxiliariesErrorInfo =
-					VehicleViewModel.MultistageAuxiliariesViewModel as IDataErrorInfo;
-				if (auxiliariesErrorInfo != null &&
-					!auxiliariesErrorInfo.Error.IsNullOrEmpty()) {
+				if (VehicleViewModel.MultistageAuxiliariesViewModel is IDataErrorInfo auxiliariesErrorInfo &&
+					!string.IsNullOrEmpty(auxiliariesErrorInfo.Error)) {
 					errorMessage += "\nAuxiliaries:\n";
 					errorMessage += auxiliariesErrorInfo.Error.Replace(",", "\n");
 				}
diff --git a/VECTOAux/VectoAuxiliariesTests/VectoAuxiliariesTests.vbproj b/VECTOAux/VectoAuxiliariesTests/VectoAuxiliariesTests.vbproj
index 27998e2d08..7a6a8c8fdb 100644
--- a/VECTOAux/VectoAuxiliariesTests/VectoAuxiliariesTests.vbproj
+++ b/VECTOAux/VectoAuxiliariesTests/VectoAuxiliariesTests.vbproj
@@ -15,7 +15,6 @@
   <ItemGroup>
     <PackageReference Include="NUnit" Version="3.13.2" />
     <PackageReference Include="NUnit3TestAdapter" Version="4.2.1" />
-    <PackageReference Include="Castle.Core" Version="4.4.1" />
     <PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
     <PackageReference Include="Ninject" Version="3.3.4" />
     <PackageReference Include="NLog" Version="4.7.13" />
diff --git a/Vecto3GUI2020Test/HelperTests/BackingStorageTest.cs b/Vecto3GUI2020Test/HelperTests/BackingStorageTest.cs
index 278bbcba1f..946d49f7d9 100644
--- a/Vecto3GUI2020Test/HelperTests/BackingStorageTest.cs
+++ b/Vecto3GUI2020Test/HelperTests/BackingStorageTest.cs
@@ -2,12 +2,8 @@
 using System.Collections.Generic;
 using System.Diagnostics;
 using System.Reflection;
-using System.Runtime.CompilerServices;
-using Castle.Components.DictionaryAdapter;
 using NUnit.Framework;
-using VECTO3GUI2020;
 using VECTO3GUI2020.ViewModel.Implementation.Common;
-using VECTO3GUI2020.ViewModel.MultiStage.Implementation;
 
 namespace Vecto3GUI2020Test.HelperTests
 {
diff --git a/Vecto3GUI2020Test/ViewModelTests/ExemptedTests.cs b/Vecto3GUI2020Test/ViewModelTests/ExemptedTests.cs
index 633077948b..9cf11d8a5c 100644
--- a/Vecto3GUI2020Test/ViewModelTests/ExemptedTests.cs
+++ b/Vecto3GUI2020Test/ViewModelTests/ExemptedTests.cs
@@ -1,9 +1,7 @@
 using System;
-using System.Diagnostics;
 using System.IO;
 using System.Linq;
 using System.Threading.Tasks;
-using Castle.Core.Logging;
 using Ninject;
 using NUnit.Framework;
 using TUGraz.VectoCommon.InputData;
diff --git a/Vecto3GUI2020Test/ViewModelTests/LoadAndSaveVehicleData.cs b/Vecto3GUI2020Test/ViewModelTests/LoadAndSaveVehicleData.cs
index 4fc8221fbe..082182fb8a 100644
--- a/Vecto3GUI2020Test/ViewModelTests/LoadAndSaveVehicleData.cs
+++ b/Vecto3GUI2020Test/ViewModelTests/LoadAndSaveVehicleData.cs
@@ -1,13 +1,5 @@
 using System;
-using System.Configuration;
 using System.IO;
-using System.Linq;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-using System.Xml;
-using Castle.Core.Internal;
-using Castle.DynamicProxy.Generators.Emitters.SimpleAST;
-using Moq;
 using Ninject;
 using NUnit.Framework;
 using TUGraz.VectoCommon.BusAuxiliaries;
@@ -15,15 +7,6 @@ using TUGraz.VectoCommon.InputData;
 using TUGraz.VectoCommon.Models;
 using TUGraz.VectoCommon.Utils;
 using TUGraz.VectoCore.InputData.FileIO.XML;
-using TUGraz.VectoCore.InputData.FileIO.XML.Declaration;
-using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider;
-using TUGraz.VectoCore.Models.Simulation.Impl;
-using TUGraz.VectoCore.Models.SimulationComponent.Strategies;
-using TUGraz.VectoCore.OutputData.FileIO;
-using TUGraz.VectoCore.Utils;
-using VECTO3GUI2020;
-using VECTO3GUI2020.Helper;
-using VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components;
 using VECTO3GUI2020.ViewModel.MultiStage.Implementation;
 
 namespace Vecto3GUI2020Test
@@ -158,9 +141,9 @@ namespace Vecto3GUI2020Test
 			var vehicleViewModel =
 				vm.MultiStageJobViewModel.ManufacturingStageViewModel.Vehicle as IMultistageVehicleViewModel;
 			Assert.NotNull(vehicleViewModel);
-			Assert.IsTrue(vehicleViewModel.Manufacturer.IsNullOrEmpty());
-			Assert.IsTrue(vehicleViewModel.ManufacturerAddress.IsNullOrEmpty());
-			Assert.IsTrue(vehicleViewModel.VIN.IsNullOrEmpty());
+			Assert.IsTrue(string.IsNullOrEmpty(vehicleViewModel.Manufacturer));
+			Assert.IsTrue(string.IsNullOrEmpty(vehicleViewModel.ManufacturerAddress));
+			Assert.IsTrue(string.IsNullOrEmpty(vehicleViewModel.VIN));
 			Assert.IsNull(vehicleViewModel.Model);
 
 			var vehicleViewModelV28 = vehicleViewModel as InterimStageBusVehicleViewModel_v2_8;
diff --git a/Vecto3GUI2020Test/ViewModelTests/VehicleViewModelTests.cs b/Vecto3GUI2020Test/ViewModelTests/VehicleViewModelTests.cs
index fcd3071ec0..e733421e90 100644
--- a/Vecto3GUI2020Test/ViewModelTests/VehicleViewModelTests.cs
+++ b/Vecto3GUI2020Test/ViewModelTests/VehicleViewModelTests.cs
@@ -1,19 +1,7 @@
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using Castle.Core.Internal;
-using Ninject;
-using NUnit.Framework;
+using NUnit.Framework;
 using TUGraz.VectoCommon.InputData;
 using TUGraz.VectoCommon.Utils;
-using TUGraz.VectoCore.InputData.FileIO.XML;
-using VECTO3GUI2020.Annotations;
-using VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components;
 using VECTO3GUI2020.ViewModel.MultiStage.Implementation;
-using VECTO3GUI2020.ViewModel.MultiStage.Interfaces;
 
 namespace Vecto3GUI2020Test.ViewModelTests
 {
@@ -144,7 +132,8 @@ namespace Vecto3GUI2020Test.ViewModelTests
 			var vehicleViewModel =
 				vm.MultiStageJobViewModel.ManufacturingStageViewModel.Vehicle as InterimStageBusVehicleViewModel_v2_8;
 
-			Assert.IsTrue(vm.MultiStageJobViewModel.ManufacturingStages.IsNullOrEmpty());
+			Assert.NotNull(vm.MultiStageJobViewModel.ManufacturingStages);
+			Assert.IsNotEmpty(vm.MultiStageJobViewModel.ManufacturingStages);
 
 			Assert.NotNull(vehicleViewModel.ConsolidatedVehicleData);
 			var consolidatedADAS = vehicleViewModel.ConsolidatedVehicleData.ADAS;
diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationVehicleDataProvider.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationVehicleDataProvider.cs
index 1b8b21484f..2012d6daea 100644
--- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationVehicleDataProvider.cs
+++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationVehicleDataProvider.cs
@@ -31,12 +31,9 @@
 
 using System;
 using System.Collections.Generic;
-using System.Linq;
 using System.Xml;
 using System.Xml.Linq;
-using Castle.Core.Internal;
 using TUGraz.VectoCommon.BusAuxiliaries;
-using TUGraz.VectoCommon.Exceptions;
 using TUGraz.VectoCommon.InputData;
 using TUGraz.VectoCommon.Models;
 using TUGraz.VectoCommon.Resources;
@@ -729,7 +726,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider
 				}
 			}
 
-			return motorTorqueLimits.IsNullOrEmpty() ? null : motorTorqueLimits;
+			return motorTorqueLimits.Count == 0 ? null : motorTorqueLimits;
 		}
 
 		private Tuple<Volt, TableData> ReadVoltageLevelNode(XmlNode voltageLevelNode)
diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLElectricMachinesDeclarationInputDataProvider.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLElectricMachinesDeclarationInputDataProvider.cs
index 40cf76cbc8..a4abc2cbdf 100644
--- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLElectricMachinesDeclarationInputDataProvider.cs
+++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLElectricMachinesDeclarationInputDataProvider.cs
@@ -1,7 +1,6 @@
 using System.Collections.Generic;
 using System.Xml;
 using System.Xml.Linq;
-using Castle.Core.Internal;
 using TUGraz.VectoCommon.InputData;
 using TUGraz.VectoCommon.Resources;
 using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Interfaces;
@@ -59,7 +58,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider
 			var gearRatios = GetNode(XMLNames.ElectricMachine_P2_5GearRatios, null, false);
 			if (gearRatios != null) {
 				var gears = GetNodes(XMLNames.GearRatio_Ratio, gearRatios);
-				if (gears.IsNullOrEmpty())
+				if (gears is null || gears.Count == 0)
 					return;
 				
 				machineEntry.RatioPerGear = new double[gears.Count];
diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLElectricMotorDeclarationInputDataProvider.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLElectricMotorDeclarationInputDataProvider.cs
index cd9cd3e799..5b4e004570 100644
--- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLElectricMotorDeclarationInputDataProvider.cs
+++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLElectricMotorDeclarationInputDataProvider.cs
@@ -3,7 +3,6 @@ using System.Collections.Generic;
 using System.Linq;
 using System.Xml;
 using System.Xml.Linq;
-using Castle.Core.Internal;
 using TUGraz.VectoCommon.InputData;
 using TUGraz.VectoCommon.Models;
 using TUGraz.VectoCommon.Resources;
@@ -99,7 +98,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider
 		protected virtual IList<IElectricMotorVoltageLevel> GetVoltageLevels()
 		{
 			var voltageLevelNodes = GetNodes(XMLNames.ElectricMachine_VoltageLevel, BaseNode);
-			if (voltageLevelNodes.IsNullOrEmpty())
+			if (voltageLevelNodes is null || voltageLevelNodes.Count == 0)
 				return null;
 
 			var voltageLevels = new List<IElectricMotorVoltageLevel>();
@@ -115,7 +114,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider
 		private IList<IElectricMotorPowerMap> GetPowerMaps()
 		{
 			var powerMapNodes = GetNodes(XMLNames.PowerMap);
-			if (powerMapNodes.IsNullOrEmpty())
+			if (powerMapNodes is null || powerMapNodes.Count == 0)
 				return null;
 
 			var powerMaps = new List<IElectricMotorPowerMap>();
@@ -355,7 +354,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider
 		private IList<IDragCurve> GetDragCurves()
 		{
 			var dragCurveNodes = GetNodes(XMLNames.DragCurve, BaseNode);
-			if (dragCurveNodes.IsNullOrEmpty())
+			if (dragCurveNodes is null || dragCurveNodes.Count == 0)
 				return null;
 
 			var dragCurves = new List<IDragCurve>();
@@ -369,7 +368,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider
 		private IList<IGearEntry> GetGearEntries()
 		{
 			var gearNodes = GetNodes(XMLNames.Gear_EntryName);
-			if (gearNodes.IsNullOrEmpty())
+			if (gearNodes is null || gearNodes.Count == 0)
 				return null;
 
 			var gears = new List<IGearEntry>();
diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/Reader/Impl/XMLDeclarationMultistageInputReader.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/Reader/Impl/XMLDeclarationMultistageInputReader.cs
index c2ba171855..31443709b4 100644
--- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/Reader/Impl/XMLDeclarationMultistageInputReader.cs
+++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/Reader/Impl/XMLDeclarationMultistageInputReader.cs
@@ -1,10 +1,8 @@
 using System;
 using System.Collections.Generic;
-using System.Diagnostics;
 using System.Linq;
 using System.Xml;
 using System.Xml.Linq;
-using Castle.Core.Internal;
 using Ninject;
 using TUGraz.VectoCommon.BusAuxiliaries;
 using TUGraz.VectoCommon.InputData;
@@ -13,7 +11,6 @@ using TUGraz.VectoCommon.Resources;
 using TUGraz.VectoCommon.Utils;
 using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Factory;
 using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Interfaces;
-using TUGraz.VectoCore.OutputData.XML;
 using TUGraz.VectoCore.OutputData.XML.DeclarationReports.VehicleInformationFile;
 using TUGraz.VectoCore.Utils;
 
@@ -99,7 +96,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Reader.Impl
 		{
 			get
 			{
-				if (_manufacturingNodeStages.IsNullOrEmpty())
+				if (_manufacturingNodeStages is null || _manufacturingNodeStages.Count == 0)
 					return null;
 
 				return _manufacturingStages ?? (_manufacturingStages = ManufacturingStagesCreator());
@@ -143,7 +140,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Reader.Impl
 		{
 			get
 			{
-				if (ManufacturingStages.IsNullOrEmpty()) {
+				if (ManufacturingStages is null || ManufacturingStages.Count == 0) {
 					_invalidEntries.Add("no manufacturing stages");
 					return false;
 				}
diff --git a/VectoCore/VectoCore/OutputData/FileIO/TempFileOutputWriter.cs b/VectoCore/VectoCore/OutputData/FileIO/TempFileOutputWriter.cs
index 9780d7daaa..f00b5ef9f3 100644
--- a/VectoCore/VectoCore/OutputData/FileIO/TempFileOutputWriter.cs
+++ b/VectoCore/VectoCore/OutputData/FileIO/TempFileOutputWriter.cs
@@ -3,8 +3,6 @@ using System.Collections.Generic;
 using System.Data;
 using System.IO;
 using System.Xml.Linq;
-using Castle.Core.Internal;
-using TUGraz.VectoCommon.Models;
 
 namespace TUGraz.VectoCore.OutputData.FileIO
 {
@@ -29,11 +27,10 @@ namespace TUGraz.VectoCore.OutputData.FileIO
 		{
 			BaseWriter = baseWriter;
 			_reportsToWrite = new HashSet<ReportType>();
-			if (!reportsToWrite.IsNullOrEmpty()) {
+			if (!(reportsToWrite is null))
 				foreach (var reportType in reportsToWrite) {
 					_reportsToWrite.Add(reportType);
 				}
-			}
 		}
 
 		#region Overrides of FileOutputWriter
diff --git a/VectoCore/VectoCore/OutputData/XML/DeclarationJobs/XMLCompletedBusWriter.cs b/VectoCore/VectoCore/OutputData/XML/DeclarationJobs/XMLCompletedBusWriter.cs
index 783cb5fe39..5dd72293d0 100644
--- a/VectoCore/VectoCore/OutputData/XML/DeclarationJobs/XMLCompletedBusWriter.cs
+++ b/VectoCore/VectoCore/OutputData/XML/DeclarationJobs/XMLCompletedBusWriter.cs
@@ -1,11 +1,6 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
+using System.Text;
 using System.Xml;
 using System.Xml.Linq;
-using Castle.Core.Internal;
-
 
 namespace TUGraz.VectoCore.OutputData.XML.DeclarationJobs
 {
@@ -23,7 +18,7 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationJobs
 		
 		public bool WriteCompletedBusXml(string filePath, XDocument xmlDocument)
 		{
-			if (filePath.IsNullOrEmpty())
+			if (string.IsNullOrEmpty(filePath))
 				return false;
 			
 			using (var xmlWriter = XmlWriter.Create(_stringBuilder, _xmlWriterSettings))
diff --git a/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/CompletedBus/CompletedBusDimensionsWriter.cs b/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/CompletedBus/CompletedBusDimensionsWriter.cs
index c0d005308a..b5e32a7a02 100644
--- a/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/CompletedBus/CompletedBusDimensionsWriter.cs
+++ b/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/CompletedBus/CompletedBusDimensionsWriter.cs
@@ -1,10 +1,4 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Xml.Linq;
-using Castle.Components.DictionaryAdapter;
+using System.Xml.Linq;
 using TUGraz.VectoCommon.InputData;
 using TUGraz.VectoCommon.Resources;
 using TUGraz.VectoCommon.Utils;
diff --git a/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/CompletedBus/CompletedBusGeneralParametersWriter.cs b/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/CompletedBus/CompletedBusGeneralParametersWriter.cs
index cc19f92a53..dcc05754ef 100644
--- a/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/CompletedBus/CompletedBusGeneralParametersWriter.cs
+++ b/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/CompletedBus/CompletedBusGeneralParametersWriter.cs
@@ -1,13 +1,6 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Xml.Linq;
-using Castle.Components.DictionaryAdapter;
+using System.Xml.Linq;
 using TUGraz.VectoCommon.InputData;
 using TUGraz.VectoCommon.Resources;
-using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Interfaces;
 using TUGraz.VectoCore.Utils;
 
 namespace TUGraz.VectoCore.OutputData.XML.GroupWriter.Declaration.Vehicle.CompletedBus
diff --git a/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/CompletedBus/CompletedBusParametersWriter.cs b/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/CompletedBus/CompletedBusParametersWriter.cs
index 88c063c914..4de8ce5d7b 100644
--- a/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/CompletedBus/CompletedBusParametersWriter.cs
+++ b/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/CompletedBus/CompletedBusParametersWriter.cs
@@ -1,10 +1,5 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+using System.Collections.Generic;
 using System.Xml.Linq;
-using Castle.Components.DictionaryAdapter;
 using TUGraz.VectoCommon.InputData;
 using TUGraz.VectoCommon.Models;
 using TUGraz.VectoCommon.Resources;
diff --git a/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/CompletedBus/CompletedBusPassengerCountWriter.cs b/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/CompletedBus/CompletedBusPassengerCountWriter.cs
index 4efe71fc36..d9eb80284c 100644
--- a/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/CompletedBus/CompletedBusPassengerCountWriter.cs
+++ b/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/CompletedBus/CompletedBusPassengerCountWriter.cs
@@ -1,10 +1,4 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Xml.Linq;
-using Castle.Components.DictionaryAdapter;
+using System.Xml.Linq;
 using TUGraz.VectoCommon.InputData;
 using TUGraz.VectoCommon.Resources;
 using TUGraz.VectoCore.Utils;
diff --git a/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/Components/Auxiliaries/BusAuxElectricSystemLightsGroupWriter.cs b/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/Components/Auxiliaries/BusAuxElectricSystemLightsGroupWriter.cs
index 3434644cd7..ef235c4a94 100644
--- a/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/Components/Auxiliaries/BusAuxElectricSystemLightsGroupWriter.cs
+++ b/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/Components/Auxiliaries/BusAuxElectricSystemLightsGroupWriter.cs
@@ -1,10 +1,4 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Xml.Linq;
-using Castle.Components.DictionaryAdapter;
+using System.Xml.Linq;
 using TUGraz.VectoCommon.InputData;
 using TUGraz.VectoCommon.Resources;
 
diff --git a/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/Components/Auxiliaries/BusAuxElectricSystemSupplyGroupWriter.cs b/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/Components/Auxiliaries/BusAuxElectricSystemSupplyGroupWriter.cs
index a78df6dce1..e6471f3220 100644
--- a/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/Components/Auxiliaries/BusAuxElectricSystemSupplyGroupWriter.cs
+++ b/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/Components/Auxiliaries/BusAuxElectricSystemSupplyGroupWriter.cs
@@ -1,12 +1,6 @@
 using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
 using System.Xml.Linq;
-using Castle.Components.DictionaryAdapter;
 using TUGraz.VectoCommon.InputData;
-using TUGraz.VectoCommon.Resources;
 
 namespace TUGraz.VectoCore.OutputData.XML.GroupWriter.Declaration.Vehicle.Components.Auxiliaries
 {
diff --git a/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/Components/Auxiliaries/BusAuxHVACConventionalGroupWriter.cs b/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/Components/Auxiliaries/BusAuxHVACConventionalGroupWriter.cs
index 855e9a2b2b..fb1acfd11c 100644
--- a/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/Components/Auxiliaries/BusAuxHVACConventionalGroupWriter.cs
+++ b/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/Components/Auxiliaries/BusAuxHVACConventionalGroupWriter.cs
@@ -1,10 +1,5 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+using System.Collections.Generic;
 using System.Xml.Linq;
-using Castle.Components.DictionaryAdapter;
 using TUGraz.VectoCommon.BusAuxiliaries;
 using TUGraz.VectoCommon.InputData;
 using TUGraz.VectoCommon.Resources;
diff --git a/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/Components/Auxiliaries/BusAuxHVACHeatPumpWriter.cs b/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/Components/Auxiliaries/BusAuxHVACHeatPumpWriter.cs
index fbb371887b..0c1694035f 100644
--- a/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/Components/Auxiliaries/BusAuxHVACHeatPumpWriter.cs
+++ b/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/Components/Auxiliaries/BusAuxHVACHeatPumpWriter.cs
@@ -1,10 +1,4 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Xml.Linq;
-using Castle.Components.DictionaryAdapter;
+using System.Xml.Linq;
 using TUGraz.VectoCommon.BusAuxiliaries;
 using TUGraz.VectoCommon.InputData;
 using TUGraz.VectoCommon.Resources;
diff --git a/VectoCore/VectoCore/OutputData/XML/GroupWriter/GroupWriter.cs b/VectoCore/VectoCore/OutputData/XML/GroupWriter/GroupWriter.cs
index 305dcbc82c..3ae468591a 100644
--- a/VectoCore/VectoCore/OutputData/XML/GroupWriter/GroupWriter.cs
+++ b/VectoCore/VectoCore/OutputData/XML/GroupWriter/GroupWriter.cs
@@ -1,8 +1,4 @@
-using System.Collections.Generic;
-using System.Configuration;
-using System.Xml.Linq;
-using Castle.Components.DictionaryAdapter;
-using TUGraz.VectoCommon.InputData;
+using System.Xml.Linq;
 
 namespace TUGraz.VectoCore.OutputData.XML.GroupWriter
 {
diff --git a/VectoCore/VectoCore/Utils/PathHelper.cs b/VectoCore/VectoCore/Utils/PathHelper.cs
index 469751b156..2459f872db 100644
--- a/VectoCore/VectoCore/Utils/PathHelper.cs
+++ b/VectoCore/VectoCore/Utils/PathHelper.cs
@@ -2,7 +2,6 @@
 using System.Collections.Generic;
 using System.IO;
 using System.Linq;
-using Castle.Core.Internal;
 
 namespace TUGraz.VectoCore.Utils
 {
@@ -27,8 +26,8 @@ namespace TUGraz.VectoCore.Utils
 			}
 
 
-			var pathArray = pathFullPath.Split(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar).Where(s => !s.IsNullOrEmpty());
-			var relativeToArray = relativeFullPath.Split(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar).Where(s => !s.IsNullOrEmpty());
+			var pathArray = pathFullPath.Split(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar).Where(s => !string.IsNullOrEmpty(s));
+			var relativeToArray = relativeFullPath.Split(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar).Where(s => !string.IsNullOrEmpty(s));
 			var result = GetRelativePath(relativeToArray, pathArray);
 
 
diff --git a/VectoCore/VectoCore/Utils/XMLHelper.cs b/VectoCore/VectoCore/Utils/XMLHelper.cs
index 7e315fa5d8..573e7a847b 100644
--- a/VectoCore/VectoCore/Utils/XMLHelper.cs
+++ b/VectoCore/VectoCore/Utils/XMLHelper.cs
@@ -36,7 +36,6 @@ using System.Linq;
 using System.Xml;
 using System.Xml.Linq;
 using System.Xml.Schema;
-using Castle.Core.Internal;
 using TUGraz.VectoCommon.Exceptions;
 using TUGraz.VectoCommon.InputData;
 using TUGraz.VectoCommon.Models;
@@ -319,7 +318,7 @@ namespace TUGraz.VectoCore.Utils
 
 		public static void AddIfContentNotNull(this XElement xElement, XElement xElementToAdd)
 		{
-			if (!xElementToAdd.Value.IsNullOrEmpty()){
+			if (!string.IsNullOrEmpty(xElementToAdd.Value)){
 				xElement.Add(xElementToAdd);
 			}
 		}
diff --git a/VectoCore/VectoCoreTest/VectoCoreTest.csproj b/VectoCore/VectoCoreTest/VectoCoreTest.csproj
index 2733448c6d..ef035eb22e 100644
--- a/VectoCore/VectoCoreTest/VectoCoreTest.csproj
+++ b/VectoCore/VectoCoreTest/VectoCoreTest.csproj
@@ -11,7 +11,6 @@
     <PackageReference Include="NUnit" Version="3.13.2" />
     <PackageReference Include="NUnit3TestAdapter" Version="4.2.1" />
     <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
-    <PackageReference Include="Castle.Core" Version="4.4.1" />
     <PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
     <PackageReference Include="Ninject" Version="3.3.4" />
     <PackageReference Include="NLog" Version="4.7.13" />
-- 
GitLab