nit: `if (!contacts || !contacts.length)`