I think you could turn those declarations into static ones (similarly to the repo) and free the reference as part of the `cleanup()`