Note that this is not an actual leak; it just seems like SonarCloud is not detecting things correctly. Will do very small refactor to make it more explicit what is happening