serviceIds could be replaced by the array_filter directly :)