Having topics as object (with ids as keys) would make this loop unneeded. But this depends on the service that gives us the topics. No action required.