Better caching in the get_sites() function