Reorder imports
Slightly more generic way to find which remote to fetch from