commit e6a01bd8a1f18450fab43c329b955876f4aea7d6
Author: Pultak <pultak5@gmail.com>
Date:   Sun May 8 13:25:41 2022 +0200

    re #9712 Added documentation of the newly implemented methods + refactoring

diff --git a/ld_client/LDClient/detection/AInfoFetcher.cs b/ld_client/LDClient/detection/AInfoFetcher.cs
index c41f581..bdacb4a 100644
--- a/ld_client/LDClient/detection/AInfoFetcher.cs
+++ b/ld_client/LDClient/detection/AInfoFetcher.cs
@@ -1,9 +1,4 @@
-﻿using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using LDClient.utils;
+﻿using LDClient.utils;
 
 namespace LDClient.detection; 
 
diff --git a/ld_client/LDClient/detection/DebuggerInfoParser.cs b/ld_client/LDClient/detection/DebuggerInfoParser.cs
index 27b80c6..a4cdee7 100644
--- a/ld_client/LDClient/detection/DebuggerInfoParser.cs
+++ b/ld_client/LDClient/detection/DebuggerInfoParser.cs
@@ -1,41 +1,40 @@
 using System.Text.RegularExpressions;
 
-namespace LDClient.detection {
+namespace LDClient.detection; 
+
+/// <summary>
+/// This class parses the .txt file generated from the debugger.
+/// Its primary interest is to find two serial numbers (head + body). 
+/// </summary>
+public static class DebuggerInfoParser {
 
     /// <summary>
-    /// This class parses the .txt file generated from the debugger.
-    /// Its primary interest is to find two serial numbers (head + body). 
+    /// Number of serial numbers expected to be in the .txt file (number of matches - regex).
     /// </summary>
-    public static class DebuggerInfoParser {
-
-        /// <summary>
-        /// Number of serial numbers expected to be in the .txt file (number of matches - regex).
-        /// </summary>
-        private const int ExpectedNumberOfMatches = 2;
+    private const int ExpectedNumberOfMatches = 2;
         
-        /// <summary>
-        /// Regular expression used to find the serial numbers.
-        /// </summary>
-        private static readonly Regex SerialNumberRegex = new("(?<=Serial Number: )(.*)");
+    /// <summary>
+    /// Regular expression used to find the serial numbers.
+    /// </summary>
+    private static readonly Regex SerialNumberRegex = new("(?<=Serial Number: )(.*)");
         
-        /// <summary>
-        /// Takes the content of a .txt file and tries to find the two serial numbers (head and body).
-        /// If it succeed, it will return the two numbers.
-        /// </summary>
-        /// <param name="dataTxt">the content of a .txt file (generated from the debugger)</param>
-        /// <returns>two serial numbers (head and body) of the debugger</returns>
-        /// <exception cref="ArgumentException">throws an exception if it fails to find the serial numbers</exception>
-        public static (string headSerialNumber, string bodySerialNumber) Parse(string dataTxt) {
-            // Find all matches in the content of the file that satisfy the regular expression.
-            var matches = SerialNumberRegex.Matches(dataTxt);
+    /// <summary>
+    /// Takes the content of a .txt file and tries to find the two serial numbers (head and body).
+    /// If it succeed, it will return the two numbers.
+    /// </summary>
+    /// <param name="dataTxt">the content of a .txt file (generated from the debugger)</param>
+    /// <returns>two serial numbers (head and body) of the debugger</returns>
+    /// <exception cref="ArgumentException">throws an exception if it fails to find the serial numbers</exception>
+    public static (string headSerialNumber, string bodySerialNumber) Parse(string dataTxt) {
+        // Find all matches in the content of the file that satisfy the regular expression.
+        var matches = SerialNumberRegex.Matches(dataTxt);
 
-            // Make sure an exact number of matches has been found.
-            if (matches.Count != ExpectedNumberOfMatches) {
-                throw new ArgumentException($"Expected {ExpectedNumberOfMatches} matches to be found in the text (actually found: {matches.Count})");
-            }
-            
-            // Return the two serial numbers (head and body).
-            return (matches[1].ToString().Trim(), matches[0].ToString().Trim());
+        // Make sure an exact number of matches has been found.
+        if (matches.Count != ExpectedNumberOfMatches) {
+            throw new ArgumentException($"Expected {ExpectedNumberOfMatches} matches to be found in the text (actually found: {matches.Count})");
         }
+            
+        // Return the two serial numbers (head and body).
+        return (matches[1].ToString().Trim(), matches[0].ToString().Trim());
     }
 }
\ No newline at end of file
diff --git a/ld_client/LDClient/detection/IInfoFetcher.cs b/ld_client/LDClient/detection/IInfoFetcher.cs
index f8c47a3..c5e871f 100644
--- a/ld_client/LDClient/detection/IInfoFetcher.cs
+++ b/ld_client/LDClient/detection/IInfoFetcher.cs
@@ -1,33 +1,26 @@
-﻿using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+﻿namespace LDClient.detection; 
+
+/// <summary>
+/// This interface defines the functionality of an info fetcher which
+/// takes care of sending commands to the debugger. 
+/// </summary>
+public interface IInfoFetcher {
 
-namespace LDClient.detection {
-    
     /// <summary>
-    /// This interface defines the functionality of an info fetcher which
-    /// takes care of sending commands to the debugger. 
+    /// Returns the head serial number of the debugger.
     /// </summary>
-    public interface IInfoFetcher {
-
-        /// <summary>
-        /// Returns the head serial number of the debugger.
-        /// </summary>
-        public string HeadSerialNumber { get; set; }
+    public string HeadSerialNumber { get; set; }
         
-        /// <summary>
-        /// Returns the body serial number of the debugger.
-        /// </summary>
-        public string BodySerialNumber { get; set; }
+    /// <summary>
+    /// Returns the body serial number of the debugger.
+    /// </summary>
+    public string BodySerialNumber { get; set; }
 
-        /// <summary>
-        /// Fetches data from the debugger. It sends the commands defined
-        /// in the appsettings.json file to the debugger and tries to
-        /// parse the .txt (contains the serial numbers).
-        /// </summary>
-        /// <returns>True, if data was fetched successfully. False otherwise.</returns>
-        public Task<bool> FetchDataAsync();
-    }
-}
+    /// <summary>
+    /// Fetches data from the debugger. It sends the commands defined
+    /// in the appsettings.json file to the debugger and tries to
+    /// parse the .txt (contains the serial numbers).
+    /// </summary>
+    /// <returns>True, if data was fetched successfully. False otherwise.</returns>
+    public Task<bool> FetchDataAsync();
+}
\ No newline at end of file
diff --git a/ld_client/LDClient/detection/IProcessDetection.cs b/ld_client/LDClient/detection/IProcessDetection.cs
index 27383f5..03a2398 100644
--- a/ld_client/LDClient/detection/IProcessDetection.cs
+++ b/ld_client/LDClient/detection/IProcessDetection.cs
@@ -1,16 +1,15 @@
-﻿namespace LDClient.detection {
-    
+﻿namespace LDClient.detection; 
+
+/// <summary>
+/// This interface defines the functionality of a process detector.
+/// A process detector is used to determine whether a user is currently
+/// using a debugger or not.
+/// </summary>
+internal interface IProcessDetection {
+        
     /// <summary>
-    /// This interface defines the functionality of a process detector.
-    /// A process detector is used to determine whether a user is currently
-    /// using a debugger or not.
+    /// Periodically runs process detection. This method is instantiated
+    /// as a thread from the main class (Program.cs).
     /// </summary>
-    internal interface IProcessDetection {
-        
-        /// <summary>
-        /// Periodically runs process detection. This method is instantiated
-        /// as a thread from the main class (Program.cs).
-        /// </summary>
-        public void RunPeriodicDetection();
-    }
+    public void RunPeriodicDetection();
 }
\ No newline at end of file
diff --git a/ld_client/LDClient/detection/IProcessUtils.cs b/ld_client/LDClient/detection/IProcessUtils.cs
index d55a663..6759e14 100644
--- a/ld_client/LDClient/detection/IProcessUtils.cs
+++ b/ld_client/LDClient/detection/IProcessUtils.cs
@@ -1,33 +1,26 @@
-﻿using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+﻿namespace LDClient.detection; 
 
-namespace LDClient.detection {
-    
+/// <summary>
+/// This interface defines the functionality of all methods that
+/// are used to work with processes (within this project).
+/// </summary>
+public interface IProcessUtils {
+        
     /// <summary>
-    /// This interface defines the functionality of all methods that
-    /// are used to work with processes (within this project).
+    /// Checks if a process is running or not.
     /// </summary>
-    public interface IProcessUtils {
-        
-        /// <summary>
-        /// Checks if a process is running or not.
-        /// </summary>
-        /// <param name="name">Name of the process</param>
-        /// <returns>True, if the process is running. False otherwise.</returns>
-        public bool IsProcessRunning(string name);
+    /// <param name="name">Name of the process</param>
+    /// <returns>True, if the process is running. False otherwise.</returns>
+    public bool IsProcessRunning(string name);
 
-        /// <summary>
-        /// Executes a new process (t32rem.exe) with arguments which are passed in
-        /// as a parameter of the method.
-        /// </summary>
-        /// <param name="fileName">Path to the .exe file</param>
-        /// <param name="argument">Arguments passed into the .exe file</param>
-        /// <param name="timeout">Timeout used when waiting for the process to terminate</param>
-        /// <param name="desiredExitCode">Status code indicating a successful termination of the process.</param>
-        /// <returns>True, if the command was executed successfully. False otherwise.</returns>
-        public bool ExecuteNewProcess(string fileName, string argument, int timeout, int desiredExitCode);
-    }
-}
+    /// <summary>
+    /// Executes a new process (t32rem.exe) with arguments which are passed in
+    /// as a parameter of the method.
+    /// </summary>
+    /// <param name="fileName">Path to the .exe file</param>
+    /// <param name="argument">Arguments passed into the .exe file</param>
+    /// <param name="timeout">Timeout used when waiting for the process to terminate</param>
+    /// <param name="desiredExitCode">Status code indicating a successful termination of the process.</param>
+    /// <returns>True, if the command was executed successfully. False otherwise.</returns>
+    public bool ExecuteNewProcess(string fileName, string argument, int timeout, int desiredExitCode);
+}
\ No newline at end of file
diff --git a/ld_client/LDClient/detection/IT32Utils.cs b/ld_client/LDClient/detection/IT32Utils.cs
index 5904691..f33fb29 100644
--- a/ld_client/LDClient/detection/IT32Utils.cs
+++ b/ld_client/LDClient/detection/IT32Utils.cs
@@ -1,15 +1,29 @@
-﻿using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+﻿namespace LDClient.detection;
 
-namespace LDClient.detection {
-    public interface IT32Utils {
 
-        public bool InitConnection();
-        public bool ExecuteCommands();
-        public bool CloseConnection();
+/// <summary>
+/// This interface defines the main functionality of an trace32 API
+/// which is mainly used to send commands to the debugger. 
+/// </summary>
+public interface IT32Utils {
+    
+    /// <summary>
+    /// This method initialized the connection with the trace32 application API.
+    /// It setups the standard connection configuration a tries to connect to the API
+    /// </summary>
+    /// <returns>true on success</returns>
+    public bool InitConnection();
 
-    }
-}
+    /// <summary>
+    /// Method executes all passed commands though the trace32 API
+    /// </summary>
+    /// <returns>true on success</returns>
+    public bool ExecuteCommands();
+
+    /// <summary>
+    /// This method closes the connection with the trace32 application api
+    /// </summary>
+    /// <returns>true on success</returns>
+    public bool CloseConnection();
+
+}
\ No newline at end of file
diff --git a/ld_client/LDClient/detection/ProcessDetection.cs b/ld_client/LDClient/detection/ProcessDetection.cs
index 4bde0fd..af47b38 100644
--- a/ld_client/LDClient/detection/ProcessDetection.cs
+++ b/ld_client/LDClient/detection/ProcessDetection.cs
@@ -1,185 +1,183 @@
-﻿using System.Diagnostics;
-using LDClient.network;
+﻿using LDClient.network;
 using LDClient.network.data;
 
-namespace LDClient.detection {
+namespace LDClient.detection; 
+
+/// <summary>
+/// This class takes care of process detection. When t32mtc (process)
+/// is detected, it means that the debugger is currently being used.
+/// The class keeps track of the current state of a debugger.
+/// </summary>
+public sealed class ProcessDetection : IProcessDetection {
 
     /// <summary>
-    /// This class takes care of process detection. When t32mtc (process)
-    /// is detected, it means that the debugger is currently being used.
-    /// The class keeps track of the current state of a debugger.
+    /// Datetime format used when sending payloads to the server.
     /// </summary>
-    public sealed class ProcessDetection : IProcessDetection {
-
-        /// <summary>
-        /// Datetime format used when sending payloads to the server.
-        /// </summary>
-        private const string DatetimeFormat = "yyyy-MM-dd hh:mm:ss";
+    private const string DatetimeFormat = "yyyy-MM-dd hh:mm:ss";
 
-        /// <summary>
-        /// Name of the process the application detects.
-        /// </summary>
-        private readonly string _processName;
+    /// <summary>
+    /// Name of the process the application detects.
+    /// </summary>
+    private readonly string _processName;
         
-        /// <summary>
-        /// How often the application check the current status of the process (cunning / not running).
-        /// </summary>
-        private readonly uint _detectionPeriodMs;
+    /// <summary>
+    /// How often the application check the current status of the process (cunning / not running).
+    /// </summary>
+    private readonly uint _detectionPeriodMs;
         
-        /// <summary>
-        /// Instance of InfoFetcher used to fetch information from the debugger
-        /// (when the process is detected).
-        /// </summary>
-        private readonly IInfoFetcher _infoFetcher;
+    /// <summary>
+    /// Instance of InfoFetcher used to fetch information from the debugger
+    /// (when the process is detected).
+    /// </summary>
+    private readonly IInfoFetcher _infoFetcher;
         
-        /// <summary>
-        /// Instance of API clients used for sending data off to the server.
-        /// </summary>
-        private readonly IApiClient _apiClient;
+    /// <summary>
+    /// Instance of API clients used for sending data off to the server.
+    /// </summary>
+    private readonly IApiClient _apiClient;
         
-        /// <summary>
-        /// Instance of ProcessUtils which encapsulates common functionality
-        /// when it comes to dealing with processes (limited by the needs of this application).
-        /// </summary>
-        private readonly IProcessUtils _processUtils;
+    /// <summary>
+    /// Instance of ProcessUtils which encapsulates common functionality
+    /// when it comes to dealing with processes (limited by the needs of this application).
+    /// </summary>
+    private readonly IProcessUtils _processUtils;
 
-        /// <summary>
-        /// Flag indicating whether the process is currently running or not.
-        /// </summary>
-        private bool _processIsActive;
+    /// <summary>
+    /// Flag indicating whether the process is currently running or not.
+    /// </summary>
+    private bool _processIsActive;
         
-        /// <summary>
-        /// Flag if the application failed to retrieve data when the process was detected.
-        /// </summary>
-        private bool _failedToRetrieveData;
+    /// <summary>
+    /// Flag if the application failed to retrieve data when the process was detected.
+    /// </summary>
+    private bool _failedToRetrieveData;
         
-        /// <summary>
-        /// Last payload that was sent to the server.
-        /// </summary>
-        private Payload? _lastConnectedPayload;
+    /// <summary>
+    /// Last payload that was sent to the server.
+    /// </summary>
+    private Payload? _lastConnectedPayload;
 
-        /// <summary>
-        /// Flag used to stop the thread (process detection).
-        /// </summary>
-        public bool DetectionRunning = false;
+    /// <summary>
+    /// Flag used to stop the thread (process detection).
+    /// </summary>
+    public bool DetectionRunning = false;
         
-        /// <summary>
-        /// Creates an instance of this class.
-        /// </summary>
-        /// <param name="processName">Name of the process the application detects</param>
-        /// <param name="detectionPeriodMs">How often the application check the current status of the process (cunning / not running)</param>
-        /// <param name="infoFetcher">Instance of InfoFetcher used to fetch information from the debugger</param>
-        /// <param name="apiClient">Instance of API clients used for sending data off to the server</param>
-        /// <param name="processUtils">Instance of ProcessUtils which encapsulates common functionality when it comes to dealing with processes (limited by the needs of this application)</param>
-        public ProcessDetection(string processName, uint detectionPeriodMs, IInfoFetcher infoFetcher,
-            IApiClient apiClient, IProcessUtils processUtils) {
-            _processName = processName;
-            _detectionPeriodMs = detectionPeriodMs;
-            _infoFetcher = infoFetcher;
-            _apiClient = apiClient;
-            _failedToRetrieveData = false;
-            _processUtils = processUtils;
-        }
+    /// <summary>
+    /// Creates an instance of this class.
+    /// </summary>
+    /// <param name="processName">Name of the process the application detects</param>
+    /// <param name="detectionPeriodMs">How often the application check the current status of the process (cunning / not running)</param>
+    /// <param name="infoFetcher">Instance of InfoFetcher used to fetch information from the debugger</param>
+    /// <param name="apiClient">Instance of API clients used for sending data off to the server</param>
+    /// <param name="processUtils">Instance of ProcessUtils which encapsulates common functionality when it comes to dealing with processes (limited by the needs of this application)</param>
+    public ProcessDetection(string processName, uint detectionPeriodMs, IInfoFetcher infoFetcher,
+        IApiClient apiClient, IProcessUtils processUtils) {
+        _processName = processName;
+        _detectionPeriodMs = detectionPeriodMs;
+        _infoFetcher = infoFetcher;
+        _apiClient = apiClient;
+        _failedToRetrieveData = false;
+        _processUtils = processUtils;
+    }
 
-        /// <summary>
-        /// Retrieves data from the debugger.
-        /// </summary>
-        /// <returns>True, if the data was fetched successfully. False, otherwise.</returns>
-        private async Task<bool> RetrieveDataFromDebugger() {
-            // Try to fetch data from the debugger.
-            var success = await _infoFetcher.FetchDataAsync();
+    /// <summary>
+    /// Retrieves data from the debugger.
+    /// </summary>
+    /// <returns>True, if the data was fetched successfully. False, otherwise.</returns>
+    private async Task<bool> RetrieveDataFromDebugger() {
+        // Try to fetch data from the debugger.
+        var success = await _infoFetcher.FetchDataAsync();
             
-            // If the data was fetched successfully, send a payload off to the server.
-            if (success) {
-                _lastConnectedPayload = await SendDataToServerAsync(_infoFetcher.HeadSerialNumber,
-                    _infoFetcher.BodySerialNumber, DatetimeFormat);
-            }
-            return success;
+        // If the data was fetched successfully, send a payload off to the server.
+        if (success) {
+            _lastConnectedPayload = await SendDataToServerAsync(_infoFetcher.HeadSerialNumber,
+                _infoFetcher.BodySerialNumber, DatetimeFormat);
         }
+        return success;
+    }
 
-        /// <summary>
-        /// Sends a payload to the server when a debugger gets disconnected.
-        /// </summary>
-        private async Task DebuggerDisconnected() {
-            // Make sure the debugger was connected in the first place.
-            if (_lastConnectedPayload is not null) {
-                // Update the status and timestamp of the last payload
-                // (the serial numbers remain the same).
-                _lastConnectedPayload.Status = ConnectionStatus.Disconnected;
-                _lastConnectedPayload.TimeStamp = DateTime.Now.ToString(DatetimeFormat);
+    /// <summary>
+    /// Sends a payload to the server when a debugger gets disconnected.
+    /// </summary>
+    private async Task DebuggerDisconnected() {
+        // Make sure the debugger was connected in the first place.
+        if (_lastConnectedPayload is not null) {
+            // Update the status and timestamp of the last payload
+            // (the serial numbers remain the same).
+            _lastConnectedPayload.Status = ConnectionStatus.Disconnected;
+            _lastConnectedPayload.TimeStamp = DateTime.Now.ToString(DatetimeFormat);
                 
-                // Send the data to the server.
-                await _apiClient.SendPayloadAsync(_lastConnectedPayload);
+            // Send the data to the server.
+            await _apiClient.SendPayloadAsync(_lastConnectedPayload);
                 
-                // Clear the last payload.
-                _lastConnectedPayload = null;
-            }
+            // Clear the last payload.
+            _lastConnectedPayload = null;
         }
+    }
 
-        /// <summary>
-        /// Checks if the t32mtc process is running or not. 
-        /// </summary>
-        private async Task DetectProcessAsync() {
-            // Check if the process is running.
-            var processExists = _processUtils.IsProcessRunning(_processName);
+    /// <summary>
+    /// Checks if the t32mtc process is running or not. 
+    /// </summary>
+    private async Task DetectProcessAsync() {
+        // Check if the process is running.
+        var processExists = _processUtils.IsProcessRunning(_processName);
 
-            // Check if the process was not running but now it is (flip flop ON). 
-            if (processExists && !_processIsActive) {
-                Program.DefaultLogger.Info($"Process started: {_processName}");
-                if (!_failedToRetrieveData) {
-                    _failedToRetrieveData = !await RetrieveDataFromDebugger();
-                }
-            }
-            // Check if the process was running but now it is not (fli flop OFF).
-            else if (!processExists && _processIsActive) {
-                Program.DefaultLogger.Info($"Process stopped: {_processName}");
-                _failedToRetrieveData = false;
-                await DebuggerDisconnected();
+        // Check if the process was not running but now it is (flip flop ON). 
+        if (processExists && !_processIsActive) {
+            Program.DefaultLogger.Info($"Process started: {_processName}");
+            if (!_failedToRetrieveData) {
+                _failedToRetrieveData = !await RetrieveDataFromDebugger();
             }
-
-            // Keep track of the current state of the debugger.
-            _processIsActive = processExists;
+        }
+        // Check if the process was running but now it is not (fli flop OFF).
+        else if (!processExists && _processIsActive) {
+            Program.DefaultLogger.Info($"Process stopped: {_processName}");
+            _failedToRetrieveData = false;
+            await DebuggerDisconnected();
         }
 
-        /// <summary>
-        /// Creates a payload and sends it to the server.
-        /// </summary>
-        /// <param name="headSerialNumber">serial number of the head of the debugger</param>
-        /// <param name="bodySerialNumber">serial number of the body of the debugger</param>
-        /// <param name="datetimeFormat">datetime format (timestamp)</param>
-        /// <returns>the newly-created payload</returns>
-        private async Task<Payload> SendDataToServerAsync(string headSerialNumber, string bodySerialNumber, string datetimeFormat) {
-            // Create a new payload. 
-            Payload payload = new() {
-                UserName = Environment.UserName,
-                HostName = Environment.MachineName,
-                TimeStamp = DateTime.Now.ToString(datetimeFormat),
-                HeadDevice = new DebuggerInfo {
-                    SerialNumber = headSerialNumber
-                },
-                BodyDevice = new DebuggerInfo {
-                    SerialNumber = bodySerialNumber
-                },
-                Status = ConnectionStatus.Connected
-            };
+        // Keep track of the current state of the debugger.
+        _processIsActive = processExists;
+    }
+
+    /// <summary>
+    /// Creates a payload and sends it to the server.
+    /// </summary>
+    /// <param name="headSerialNumber">serial number of the head of the debugger</param>
+    /// <param name="bodySerialNumber">serial number of the body of the debugger</param>
+    /// <param name="datetimeFormat">datetime format (timestamp)</param>
+    /// <returns>the newly-created payload</returns>
+    private async Task<Payload> SendDataToServerAsync(string headSerialNumber, string bodySerialNumber, string datetimeFormat) {
+        // Create a new payload. 
+        Payload payload = new() {
+            UserName = Environment.UserName,
+            HostName = Environment.MachineName,
+            TimeStamp = DateTime.Now.ToString(datetimeFormat),
+            HeadDevice = new DebuggerInfo {
+                SerialNumber = headSerialNumber
+            },
+            BodyDevice = new DebuggerInfo {
+                SerialNumber = bodySerialNumber
+            },
+            Status = ConnectionStatus.Connected
+        };
             
-            // Send it to the server and return it.
-            await _apiClient.SendPayloadAsync(payload);
-            return payload;
-        }
+        // Send it to the server and return it.
+        await _apiClient.SendPayloadAsync(payload);
+        return payload;
+    }
 
-        /// <summary>
-        /// Periodically runs process detection. This method is instantiated
-        /// as a thread from the main class (Program.cs).
-        /// </summary>
-        public async void RunPeriodicDetection() {
-            Program.DefaultLogger.Info("Process periodic detector has started");
-            DetectionRunning = true;
+    /// <summary>
+    /// Periodically runs process detection. This method is instantiated
+    /// as a thread from the main class (Program.cs).
+    /// </summary>
+    public async void RunPeriodicDetection() {
+        Program.DefaultLogger.Info("Process periodic detector has started");
+        DetectionRunning = true;
             
-            while (DetectionRunning) {
-                await DetectProcessAsync();
-                Thread.Sleep((int) _detectionPeriodMs);
-            }
+        while (DetectionRunning) {
+            await DetectProcessAsync();
+            Thread.Sleep((int) _detectionPeriodMs);
         }
     }
-}
+}
\ No newline at end of file
diff --git a/ld_client/LDClient/detection/ProcessUtils.cs b/ld_client/LDClient/detection/ProcessUtils.cs
index 5c448e7..af52955 100644
--- a/ld_client/LDClient/detection/ProcessUtils.cs
+++ b/ld_client/LDClient/detection/ProcessUtils.cs
@@ -1,60 +1,54 @@
-﻿using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+﻿using System.Diagnostics;
+
+namespace LDClient.detection; 
+
+/// <summary>
+/// This class implements the IProcessUtils interface.
+/// It implements methods that are used when dealing with processes.
+/// </summary>
+public class ProcessUtils : IProcessUtils {
 
-namespace LDClient.detection {
-    
     /// <summary>
-    /// This class implements the IProcessUtils interface.
-    /// It implements methods that are used when dealing with processes.
+    /// Checks if a process is running or not.
     /// </summary>
-    public class ProcessUtils : IProcessUtils {
-
-        /// <summary>
-        /// Checks if a process is running or not.
-        /// </summary>
-        /// <param name="name">Name of the process</param>
-        /// <returns>True, if the process is running. False otherwise.</returns>
-        public bool IsProcessRunning(string name) {
-            return Process.GetProcessesByName(name).Length > 0;
-        }
+    /// <param name="name">Name of the process</param>
+    /// <returns>True, if the process is running. False otherwise.</returns>
+    public bool IsProcessRunning(string name) {
+        return Process.GetProcessesByName(name).Length > 0;
+    }
         
-        /// <summary>
-        /// Executes a new process (t32rem.exe) with arguments which are passed in
-        /// as a parameter of the method.
-        /// </summary>
-        /// <param name="fileName">Path to the .exe file</param>
-        /// <param name="argument">Arguments passed into the .exe file</param>
-        /// <param name="timeout">Timeout used when waiting for the process to terminate</param>
-        /// <param name="desiredExitCode">Status code indicating a successful termination of the process.</param>
-        /// <returns>True, if the command was executed successfully. False otherwise.</returns>
-        public bool ExecuteNewProcess(string fileName, string argument, int timeout, int desiredExitCode) {
-            // Create a new process.
-            var t32RemProcess = new Process();
-            t32RemProcess.StartInfo.FileName = fileName;
-            t32RemProcess.StartInfo.Arguments = argument;
+    /// <summary>
+    /// Executes a new process (t32rem.exe) with arguments which are passed in
+    /// as a parameter of the method.
+    /// </summary>
+    /// <param name="fileName">Path to the .exe file</param>
+    /// <param name="argument">Arguments passed into the .exe file</param>
+    /// <param name="timeout">Timeout used when waiting for the process to terminate</param>
+    /// <param name="desiredExitCode">Status code indicating a successful termination of the process.</param>
+    /// <returns>True, if the command was executed successfully. False otherwise.</returns>
+    public bool ExecuteNewProcess(string fileName, string argument, int timeout, int desiredExitCode) {
+        // Create a new process.
+        var t32RemProcess = new Process();
+        t32RemProcess.StartInfo.FileName = fileName;
+        t32RemProcess.StartInfo.Arguments = argument;
             
-            try {
-                // Execute the process and wait until it terminates or until the timeout is up.
-                t32RemProcess.Start();
-                if (!t32RemProcess.WaitForExit(timeout)) {
-                    Program.DefaultLogger.Error($"Execution has not terminated within a predefined timeout of {timeout} ms");
-                    return false;
-                }
+        try {
+            // Execute the process and wait until it terminates or until the timeout is up.
+            t32RemProcess.Start();
+            if (!t32RemProcess.WaitForExit(timeout)) {
+                Program.DefaultLogger.Error($"Execution has not terminated within a predefined timeout of {timeout} ms");
+                return false;
+            }
                 
-                // Check if the process terminated successfully.
-                if (t32RemProcess.ExitCode != desiredExitCode) {
-                    Program.DefaultLogger.Error($"Execution terminated with an error code of {t32RemProcess.ExitCode}");
-                    return false;
-                }
-            } catch (Exception exception) {
-                Program.DefaultLogger.Error($"Failed to run {fileName} {argument}. {exception.Message}");
+            // Check if the process terminated successfully.
+            if (t32RemProcess.ExitCode != desiredExitCode) {
+                Program.DefaultLogger.Error($"Execution terminated with an error code of {t32RemProcess.ExitCode}");
                 return false;
             }
-            return true;
+        } catch (Exception exception) {
+            Program.DefaultLogger.Error($"Failed to run {fileName} {argument}. {exception.Message}");
+            return false;
         }
+        return true;
     }
-}
+}
\ No newline at end of file
diff --git a/ld_client/LDClient/detection/T32ApiFetcher.cs b/ld_client/LDClient/detection/T32ApiFetcher.cs
index 50a5deb..893e95e 100644
--- a/ld_client/LDClient/detection/T32ApiFetcher.cs
+++ b/ld_client/LDClient/detection/T32ApiFetcher.cs
@@ -1,103 +1,167 @@
-﻿using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Runtime.InteropServices;
-using System.Text;
-using System.Threading.Tasks;
+﻿using System.Runtime.InteropServices;
 
-namespace LDClient.detection {
+namespace LDClient.detection; 
 
-    public class T32ApiFetcher : AInfoFetcher, IT32Utils {
+public class T32ApiFetcher : AInfoFetcher, IT32Utils {
 #if _WINDOWS
-        private const string T32DllLibrary = "./lib/t32api64.dll";
+    /// <summary>
+    /// Path to the Trace32 API library
+    /// </summary>
+    private const string T32DllLibrary = "./lib/t32api64.dll";
 #else
         private const string T32DllLibrary = "./lib/t32api64.so";
 #endif
+    /// <summary>
+    /// Address of the listening t32 application
+    /// </summary>
+    private readonly string _t32Address;
+
+    /// <summary>
+    ///  Port of the listening t32 application
+    /// </summary>
+    private readonly string _t32Port;
+
+    /// <summary>
+    /// Size of the packets send/received from t32 application
+    /// </summary>
+    private readonly string _t32PacketLength;
+
+    /// <summary>
+    /// List of commands to be executed by though the t32 api
+    /// </summary>
+    private readonly string[] _commands;
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="maxAttempts">Maximum number of attempts to locate and parse the .txt file</param>
+    /// <param name="waitPeriodMs">Period (how often) the application tries to locate and parse the .txt file</param>
+    /// <param name="infoFilePath">Path to the .txt file which is generated from the debugger</param>
+    /// <param name="t32Address">Address of the listening t32 application</param>
+    /// <param name="t32Port">Port of the listening t32 application</param>
+    /// <param name="t32PacketLength"> Size of the packets send/received from t32 application </param>
+    /// <param name="commands"> List of commands to be executed by though the t32 api</param>
+    public T32ApiFetcher(uint maxAttempts, uint waitPeriodMs, string infoFilePath, string t32Address, 
+        string t32Port, string t32PacketLength, string[] commands) : base(maxAttempts, waitPeriodMs, infoFilePath) {
+        this._t32Address = t32Address;
+        this._t32Port = t32Port;
+        this._t32PacketLength = t32PacketLength;
+        this._commands = commands;
+    }
 
-        private readonly string _t32Address;
-        private readonly string _t32Port;
-        private readonly string _t32PacketLength;
-        private readonly string[] _commands;
-
-        public T32ApiFetcher(uint maxAttempts, uint waitPeriodMs, string infoFilePath, string t32Address, 
-            string t32Port, string t32PacketLength, string[] commands) : base(maxAttempts, waitPeriodMs, infoFilePath) {
-            this._t32Address = t32Address;
-            this._t32Port = t32Port;
-            this._t32PacketLength = t32PacketLength;
-            this._commands = commands;
-        }
-
-
-        [DllImport(T32DllLibrary, CharSet = CharSet.Ansi)]
-        private static extern int T32_Config(string s1, string s2);
-
-        [DllImport(T32DllLibrary, CharSet = CharSet.Ansi)]
-        private static extern int T32_Init();
 
-        [DllImport(T32DllLibrary, CharSet = CharSet.Ansi)]
-        private static extern int T32_Attach(int dev);
+    /// <summary>
+    /// To see full documentation of following T32 API methods please check the https://www2.lauterbach.com/pdf/api_remote_c.pdf
+    /// </summary>
+    /// <param name="s1"></param>
+    /// <param name="s2"></param>
+    /// <returns>return code</returns>
+    [DllImport(T32DllLibrary, CharSet = CharSet.Ansi)]
+    private static extern int T32_Config(string s1, string s2);
+
+    /// <summary>
+    /// To see full documentation of following T32 API methods please check the https://www2.lauterbach.com/pdf/api_remote_c.pdf
+    /// </summary>
+    /// <returns>Return code</returns>
+    [DllImport(T32DllLibrary, CharSet = CharSet.Ansi)]
+    private static extern int T32_Init();
+
+    /// <summary>
+    /// To see full documentation of following T32 API methods please check the https://www2.lauterbach.com/pdf/api_remote_c.pdf
+    /// </summary>
+    /// <param name="dev"></param>
+    /// <returns>Return code</returns>
+    [DllImport(T32DllLibrary, CharSet = CharSet.Ansi)]
+    private static extern int T32_Attach(int dev);
+
+    /// <summary>
+    /// To see full documentation of following T32 API methods please check the https://www2.lauterbach.com/pdf/api_remote_c.pdf
+    /// </summary>
+    /// <param name="command"></param>
+    /// <returns>Return code</returns>
+    [DllImport(T32DllLibrary, CharSet = CharSet.Ansi)]
+    private static extern int T32_Cmd(string command);
+
+    /// <summary>
+    /// To see full documentation of following T32 API methods please check the https://www2.lauterbach.com/pdf/api_remote_c.pdf
+    /// </summary>
+    /// <returns>Return code</returns>
+    [DllImport(T32DllLibrary, CharSet = CharSet.Ansi)]
+    private static extern int T32_Exit();
+
+
+    /// <summary>
+    /// This method initialized the connection with the trace32 application API.
+    /// It setups the standard connection configuration a tries to connect to the API
+    /// </summary>
+    /// <returns>true on success</returns>
+    public bool InitConnection() {
+        Program.DefaultLogger.Debug("Trace32 connection initialization");
+        var config1 = T32_Config("NODE=", _t32Address);
+        var config2 = T32_Config("PORT=", _t32Port);
+        var config3 = T32_Config("PACKLEN=", _t32PacketLength);
+
+        if (config1 != 0 || config2 != 0 || config3 != 0) {
+            Program.DefaultLogger.Error("Trace32 API connection configuration failed.");
+            return false;
+        }
+        var init = T32_Init();
+        if (init != 0) {
+            Program.DefaultLogger.Error("Trace32 API connection init failed.");
+            return false;
+        }
 
-        [DllImport(T32DllLibrary, CharSet = CharSet.Ansi)]
-        private static extern int T32_Cmd(string command);
+        var attach = T32_Attach(1);
+        if (attach != 0) {
+            Program.DefaultLogger.Error("Trace32 API connection attach failed.");
+        }
 
-        [DllImport(T32DllLibrary, CharSet = CharSet.Ansi)]
-        private static extern int T32_Exit();
-        
-        public bool InitConnection() {
-            Program.DefaultLogger.Debug("Trace32 connection initialization");
-            var config1 = T32_Config("NODE=", _t32Address);
-            var config2 = T32_Config("PORT=", _t32Port);
-            var config3 = T32_Config("PACKLEN=", _t32PacketLength);
+        Program.DefaultLogger.Info("Trace32 connection established");
+        return true;
+    }
 
-            if (config1 != 0 || config2 != 0 || config3 != 0) {
-                Program.DefaultLogger.Error("Trace32 API connection configuration failed.");
-                return false;
-            }
-            var init = T32_Init();
-            if (init != 0) {
-                Program.DefaultLogger.Error("Trace32 API connection init failed.");
+    /// <summary>
+    /// Method executes all passed commands though the trace32 API
+    /// </summary>
+    /// <returns>true on success</returns>
+    public bool ExecuteCommands() {
+        Program.DefaultLogger.Info("Trace32 API commands execution.");
+        foreach (var command in _commands) {
+            Program.DefaultLogger.Debug($"Executing Trace32 command '{command}'.");
+            var ret = T32_Cmd(command);
+            if (ret != 0) {
+                Program.DefaultLogger.Error($"Execution of command '{command}' failed. Return code {ret}.");
                 return false;
             }
-
-            var attach = T32_Attach(1);
-            if (attach != 0) {
-                Program.DefaultLogger.Error("Trace32 API connection attach failed.");
-            }
-
-            Program.DefaultLogger.Info("Trace32 connection established");
-            return true;
-        }
-
-        public bool ExecuteCommands() {
-            Program.DefaultLogger.Info("Trace32 API commands execution.");
-            foreach (var command in _commands) {
-                Program.DefaultLogger.Debug($"Executing Trace32 command '{command}'.");
-                var ret = T32_Cmd(command);
-                if (ret != 0) {
-                    Program.DefaultLogger.Error($"Execution of command '{command}' failed. Return code {ret}.");
-                    return false;
-                }
-            }
-            Program.DefaultLogger.Info("All Trace32 commands executed successfully.");
-            return true;
-        }
-
-        public bool CloseConnection() {
-            Program.DefaultLogger.Debug("Trace32 connection exit");
-            return T32_Exit() == 0;
         }
+        Program.DefaultLogger.Info("All Trace32 commands executed successfully.");
+        return true;
+    }
 
-        protected override bool FetchData() {
-            var connected = false;
-            for (var i = 0; i < _maxAttempts; i++) {
-                connected = InitConnection();
-                if (connected) {
-                    break;
-                }
-                Thread.Sleep((int)_waitPeriodMs);
+    /// <summary>
+    /// This method closes the connection with the trace32 application api
+    /// </summary>
+    /// <returns>true on success</returns>
+    public bool CloseConnection() {
+        Program.DefaultLogger.Debug("Trace32 connection exit");
+        return T32_Exit() == 0;
+    }
 
+    /// <summary>
+    /// Method tries to fetch the data from the trace32 application.
+    /// Upon connection fail it tries again for specified number of times
+    /// </summary>
+    /// <returns>true on success</returns>
+    protected override bool FetchData() {
+        var connected = false;
+        for (var i = 0; i < _maxAttempts; i++) {
+            connected = InitConnection();
+            if (connected) {
+                break;
             }
-            return connected && ExecuteCommands() && CloseConnection();
+            Thread.Sleep((int)_waitPeriodMs);
+
         }
+        return connected && ExecuteCommands() && CloseConnection();
     }
-}
+}
\ No newline at end of file
diff --git a/ld_client/LDClient/detection/T32RemFetcher.cs b/ld_client/LDClient/detection/T32RemFetcher.cs
index 30dbeb0..91bda8c 100644
--- a/ld_client/LDClient/detection/T32RemFetcher.cs
+++ b/ld_client/LDClient/detection/T32RemFetcher.cs
@@ -1,72 +1,71 @@
-using System.Diagnostics;
-using LDClient.utils;
-using LDClient.utils.loggers;
+namespace LDClient.detection; 
 
-namespace LDClient.detection {
+public class T32RemFetcher : AInfoFetcher{
 
-    public class T32RemFetcher : AInfoFetcher{
+    /// <summary>
+    /// Path to the t32rem.exe file which is used to send commands to the debugger.
+    /// </summary>
+    private readonly string _f32RemExecutable;
 
-        /// <summary>
-        /// Path to the t32rem.exe file which is used to send commands to the debugger.
-        /// </summary>
-        private readonly string _f32RemExecutable;
+    /// <summary>
+    /// Arguments (commands) sent to the debugger in order to generate a .txt file
+    /// containing all the desired information.
+    /// </summary>
+    private readonly string[] _f32RemArguments;
 
-        /// <summary>
-        /// Arguments (commands) sent to the debugger in order to generate a .txt file
-        /// containing all the desired information.
-        /// </summary>
-        private readonly string[] _f32RemArguments;
+    /// <summary>
+    /// Status code indicating a successful termination of t32rem.exe
+    /// </summary>
+    private readonly int _f32SuccessExitCode;
 
-        /// <summary>
-        /// Status code indicating a successful termination of t32rem.exe
-        /// </summary>
-        private readonly int _f32SuccessExitCode;
 
+    /// <summary>
+    /// Timeout used when waiting for the t32rem.exe to finish.
+    /// </summary>
+    private readonly int _f32WaitTimeoutMs;
 
-        /// <summary>
-        /// Timeout used when waiting for the t32rem.exe to finish.
-        /// </summary>
-        private readonly int _f32WaitTimeoutMs;
+    /// <summary>
+    /// Instance of ProcessUtils which encapsulates common functionality
+    /// when it comes to dealing with processes (limited by the needs of this application).
+    /// </summary>
+    public IProcessUtils ProcessUtils;
 
-        /// <summary>
-        /// Instance of ProcessUtils which encapsulates common functionality
-        /// when it comes to dealing with processes (limited by the needs of this application).
-        /// </summary>
-        public IProcessUtils ProcessUtils;
+    /// <summary>
+    /// Creates an instance of this class.
+    /// </summary>
+    /// <param name="maxAttempts">Maximum number of attempts to locate and parse the .txt file</param>
+    /// <param name="waitPeriodMs">Period (how often) the application tries to locate and parse the .txt file</param>
+    /// <param name="infoFilePath">Path to the .txt file which is generated from the debugger</param>
+    /// <param name="f32RemExecutable">Path to the t32rem.exe file which is used to send commands to the debugger</param>
+    /// <param name="f32RemArguments">Arguments (commands) sent to the debugger in order to generate a .txt file containing all the desired information.</param>
+    /// <param name="f32SuccessExitCode">Status code indicating a successful termination of t32rem.exe</param>
+    /// <param name="f32WaitTimeoutMs">Timeout used when waiting for the t32rem.exe to finish</param>
+    public T32RemFetcher(uint maxAttempts, uint waitPeriodMs, string infoFilePath, string f32RemExecutable,
+        string[] f32RemArguments, int f32SuccessExitCode, int f32WaitTimeoutMs) : base(maxAttempts, waitPeriodMs, infoFilePath) {
+        _f32RemExecutable = f32RemExecutable;
+        _f32RemArguments = f32RemArguments;
+        _f32SuccessExitCode = f32SuccessExitCode;
+        _f32WaitTimeoutMs = f32WaitTimeoutMs;
+        ProcessUtils = new ProcessUtils();
 
-        /// <summary>
-        /// Creates an instance of this class.
-        /// </summary>
-        /// <param name="maxAttempts">Maximum number of attempts to locate and parse the .txt file</param>
-        /// <param name="waitPeriodMs">Period (how often) the application tries to locate and parse the .txt file</param>
-        /// <param name="infoFilePath">Path to the .txt file which is generated from the debugger</param>
-        /// <param name="f32RemExecutable">Path to the t32rem.exe file which is used to send commands to the debugger</param>
-        /// <param name="f32RemArguments">Arguments (commands) sent to the debugger in order to generate a .txt file containing all the desired information.</param>
-        /// <param name="f32SuccessExitCode">Status code indicating a successful termination of t32rem.exe</param>
-        /// <param name="f32WaitTimeoutMs">Timeout used when waiting for the t32rem.exe to finish</param>
-
-        public T32RemFetcher(uint maxAttempts, uint waitPeriodMs, string infoFilePath, string f32RemExecutable,
-            string[] f32RemArguments, int f32SuccessExitCode, int f32WaitTimeoutMs) : base(maxAttempts, waitPeriodMs, infoFilePath) {
-            _f32RemExecutable = f32RemExecutable;
-            _f32RemArguments = f32RemArguments;
-            _f32SuccessExitCode = f32SuccessExitCode;
-            _f32WaitTimeoutMs = f32WaitTimeoutMs;
-            ProcessUtils = new ProcessUtils();
+    }
 
+    /// <summary>
+    /// Method tries to fetch the data from the trace32 application
+    /// via defined executable 
+    /// </summary>
+    /// <returns>true upon success</returns>
+    protected override bool FetchData() {
+        if (_f32RemArguments == null) {
+            Program.DefaultLogger.Error($"Failed to run {_f32RemExecutable} - no parameters were given");
+            return false;
         }
-
-        protected override bool FetchData() {
-            if (_f32RemArguments == null) {
-                Program.DefaultLogger.Error($"Failed to run {_f32RemExecutable} - no parameters were given");
+        // Execute one all arguments (commands) one by one.
+        foreach (var argument in _f32RemArguments) {
+            if (!ProcessUtils.ExecuteNewProcess(_f32RemExecutable, argument, _f32WaitTimeoutMs, _f32SuccessExitCode)) {
                 return false;
             }
-            // Execute one all arguments (commands) one by one.
-            foreach (var argument in _f32RemArguments) {
-                if (!ProcessUtils.ExecuteNewProcess(_f32RemExecutable, argument, _f32WaitTimeoutMs, _f32SuccessExitCode)) {
-                    return false;
-                }
-            }
-            return true;
         }
+        return true;
     }
 }
\ No newline at end of file
diff --git a/ld_client/LDClient/utils/ConfigLoader.cs b/ld_client/LDClient/utils/ConfigLoader.cs
index f585cce..3544c46 100644
--- a/ld_client/LDClient/utils/ConfigLoader.cs
+++ b/ld_client/LDClient/utils/ConfigLoader.cs
@@ -39,11 +39,6 @@ namespace LDClient.utils {
         private const string DdSection = "DebuggerDetection";
 
 
-        public string[] T32ApiCommands { get; private set; } = null!;
-        public string T32ApiAddress { get; private set; } = null!;
-        public string T32ApiPort { get; private set; } = null!;
-        public string T32ApiPacketLen { get; private set; } = null!;
-
         #region Logger
 
         /// <summary>
@@ -169,6 +164,27 @@ namespace LDClient.utils {
         /// </summary>
         public int T32RemWaitTimeoutMs { get; private set; }
 
+
+        /// <summary>
+        /// List of commands to be executed by though the t32 api
+        /// </summary>
+        public string[] T32ApiCommands { get; private set; } = null!;
+
+        /// <summary>
+        /// Address of the listening t32 application
+        /// </summary>
+        public string T32ApiAddress { get; private set; } = null!;
+
+        /// <summary>
+        /// Port of the listening t32 application
+        /// </summary>
+        public string T32ApiPort { get; private set; } = null!;
+
+        /// <summary>
+        /// Size of the packets send/received from t32 application
+        /// </summary>
+        public string T32ApiPacketLen { get; private set; } = null!;
+
         #endregion
 
         /// <summary>
