The only part of $item you use is its id, so pass that instead?