Restructure load_redirects code