Fix minor formatting, use match-case in getPreferredLocations