One of the best solution man! Is there any other way to do this in .NET 9 with less number of lines of code?