Here I just fixed the one that sonar was complaining about but you are absolutely right. I will likely be raising a separate issue to cover the other sonar complaints, I can address this in the PR for that.